-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yaml
More file actions
98 lines (96 loc) · 3.04 KB
/
.golangci.yaml
File metadata and controls
98 lines (96 loc) · 3.04 KB
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
# Useful config recomendation guide:
# https://gist.github.com/maratori/47a4d00457a92aa426dbd48a18776322
#
version: "2"
linters:
default: all
disable:
- varnamelen # impractical IRL.
- godox # TODO: statements are useful and shouldn't make a linter error.
- exhaustruct # more annoying than useful.
- forbidigo
- noinlineerr
- wsl
exclusions:
rules:
- path: 'internal\/flags\/vars\.go'
linters:
- gochecknoglobals
- path: 'internal\/files\/version\.go'
linters:
- gochecknoglobals
- path: 'internal\/git\/command\.go'
linters:
- noctx
- path: 'internal\/version\/*'
linters:
- revive
text: 'var-naming: avoid package names that conflict with Go standard library package names'
- path: '_test\.go'
linters:
- noctx
- funlen
- err113
- gochecknoglobals
- text: 'unused-parameter: parameter \S+ seems to be unused, consider removing or renaming it as _'
linters:
- revive
settings:
depguard:
rules:
"deprecated":
files:
- "$all"
deny:
- pkg: github.com/satori/go.uuid
desc: Use github.com/google/uuid instead, satori's package is not maintained
- pkg: github.com/gofrs/uuid$
desc: Use github.com/gofrs/uuid/v5 or later, it was not a go module before v5
- pkg: github.com/pkg/errors
desc: Use std lib
"non-test files":
files:
- "!$test"
deny:
- pkg: math/rand$
desc: Use math/rand/v2 instead, see https://go.dev/blog/randv2
exhaustruct:
# List of regular expressions to exclude struct packages and their names from checks.
# Regular expressions must match complete canonical struct package/name/structname.
# Default: []
exclude:
# std libs
- ^net/http.Client$
- ^net/http.Cookie$
- ^net/http.Request$
- ^net/http.Response$
- ^net/http.Server$
- ^net/http.Transport$
- ^net/url.URL$
- ^os/exec.Cmd$
- ^reflect.StructField$
# public libs
- ^github.com/Shopify/sarama.Config$
- ^github.com/Shopify/sarama.ProducerMessage$
- ^github.com/mitchellh/mapstructure.DecoderConfig$
- ^github.com/prometheus/client_golang/.+Opts$
- ^github.com/spf13/cobra.Command$
- ^github.com/spf13/cobra.CompletionOptions$
- ^github.com/stretchr/testify/mock.Mock$
- ^github.com/testcontainers/testcontainers-go.+Request$
- ^github.com/testcontainers/testcontainers-go.FromDockerfile$
- ^golang.org/x/tools/go/analysis.Analyzer$
- ^google.golang.org/protobuf/.+Options$
- ^gopkg.in/yaml.v3.Node$
wsl_v5:
allow-first-in-block: true
allow-whole-block: false
branch-max-lines: 2
case-max-lines: 0
formatters:
enable:
- gofumpt
- goimports
- golines
run:
timeout: 2m