forked from bufbuild/buf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
122 lines (122 loc) · 3.31 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
run:
skip-dirs-use-default: false
linters-settings:
errcheck:
check-type-assertions: true
forbidigo:
forbid:
# Use private/pkg/thread.Parallelize
- '^errgroup\.'
# Use private/pkg/command.Runner
- '^exec\.Cmd$'
- '^exec\.Command$'
- '^exec\.CommandContext$'
# os.Rename does not work across filesystem boundaries
# See https://github.com/bufbuild/buf/issues/639
- '^os\.Rename$'
# Ban debug statements
- '^fmt\.Print'
- '^log\.'
- '^print$'
- '^println$'
importas:
alias:
- pkg: github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1
alias: imagev1
- pkg: github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1
alias: modulev1
- pkg: github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1
alias: registryv1alpha1
linters:
enable:
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- deadcode
- decorder
- depguard
- dogsled
- errcheck
- exportloopref
- forbidigo
- forcetypeassert
- gochecknoinits
- gofmt
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- grouper
- importas
- ineffassign
- makezero
- misspell
- nakedret
- nilerr
- nolintlint
- predeclared
- promlinter
- rowserrcheck
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unused
- varcheck
- wastedassign
- whitespace
disable-all: true
issues:
exclude-rules:
- linters:
- forbidigo
# this is the one file we want to allow exec.Cmd functions in
path: private/pkg/command/runner.go
- linters:
- stylecheck
text: "ST1005:"
- linters:
- errcheck
# headers.go has casts with values from contexts that should fail if there
# is no error, but it would be very unidiomatic to return an error from
# the functions that do these casts, and we completely control the
# context values within this file
path: private/pkg/rpc/headers.go
- linters:
- gosec
# G101 checks for hardcoded credentials, and the variables named "*Password*
# trip this off.
path: private/buf/bufcli/bufcli.go
text: "G101:"
- linters:
- gosec
# G204 checks that exec.Command is not called with non-constants.
path: private/pkg/command/runner.go
text: "G204:"
- linters:
- wastedassign
# netrc/internal is a library largely copied in from an external repository with attribution.
# We try to make minimal edits.
path: private/pkg/netrc/internal/internal.go
# we actually want to use this init in testing
- linters:
- gochecknoinits
path: private/bufpkg/bufmodule/bufmoduletesting/bufmoduletesting.go
# we actually want to use this init
- linters:
- gochecknoinits
path: private/usage/usage.go
# we actually want to embed a context here
- linters:
- containedctx
path: private/bufpkg/bufmodule/bufmoduleprotoparse/path_resolver.go
# we actually want to embed a context here
- linters:
- containedctx
path: private/pkg/transport/grpc/grpcclient/client_conn_provider.go