1- linters-settings :
2- dupl :
3- threshold : 100
4- funlen :
5- lines : -1 # the number of lines (code + empty lines) is not a right metric and leads to code without empty line or one-liner.
6- statements : 50
7- goconst :
8- min-len : 2
9- min-occurrences : 3
10- gocritic :
11- enabled-tags :
12- - diagnostic
13- - experimental
14- - opinionated
15- - performance
16- - style
17- disabled-checks :
18- - dupImport # https://github.com/go-critic/go-critic/issues/845
19- - ifElseChain
20- - octalLiteral
21- - whyNoLint
22- gocyclo :
23- min-complexity : 15
24- gofmt :
25- rewrite-rules :
26- - pattern : ' interface{}'
27- replacement : ' any'
28- goimports :
29- local-prefixes : github.com/golangci/golangci-lint
30- gomnd :
31- # don't include the "operation" and "assign"
32- checks :
33- - argument
34- - case
35- - condition
36- - return
37- ignored-numbers :
38- - ' 0'
39- - ' 1'
40- - ' 2'
41- - ' 3'
42- ignored-functions :
43- - strings.SplitN
44-
45- govet :
46- check-shadowing : true
47- settings :
48- printf :
49- funcs :
50- - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
51- - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
52- - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
53- - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
54- errorlint :
55- asserts : false
56- lll :
57- line-length : 140
58- misspell :
59- locale : US
60- nolintlint :
61- allow-unused : false # report any unused nolint directives
62- require-explanation : false # don't require an explanation for nolint directives
63- require-specific : false # don't require nolint directives to be specific about which linter is being skipped
64- revive :
65- rules :
66- - name : unexported-return
67- disabled : true
68- - name : unused-parameter
1+ ---
2+ version : " 2"
3+ # Configure which files to skip during linting
4+ run :
5+ tests : false
696
707linters :
71- disable-all : true
72- enable :
73- - bodyclose
74- # - depguard
75- - dogsled
76- - dupl
77- - errcheck
78- - errorlint
79- - exportloopref
80- - funlen
81- - gocheckcompilerdirectives
82- - gochecknoinits
83- - goconst
84- - gocritic
85- - gocyclo
86- - gofmt
87- - goimports
88- - gomnd
89- - goprintffuncname
90- - gosec
91- - gosimple
92- - govet
93- - ineffassign
94- - lll
95- - misspell
96- - nakedret
97- - noctx
98- - nolintlint
99- - revive
100- - staticcheck
101- - stylecheck
102- - typecheck
103- - unconvert
104- - unparam
105- - unused
106- - whitespace
107-
108- # don't enable:
109- # - asciicheck
110- # - scopelint
111- # - gochecknoglobals
112- # - gocognit
113- # - godot
114- # - godox
115- # - goerr113
116- # - interfacer
117- # - maligned
118- # - nestif
119- # - prealloc
120- # - testpackage
121- # - wsl
122-
123- issues :
124- # Excluding configuration per-path, per-linter, per-text and per-source
125- exclude-rules :
126- - path : _test\.go
127- linters :
128- - gomnd
8+ default : all
1299
130- - path : pkg/golinters/errcheck.go
131- text : " SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead"
132- - path : pkg/commands/run.go
133- text : " SA1019: lsc.Errcheck.Exclude is deprecated: use ExcludeFunctions instead"
134- - path : pkg/commands/run.go
135- text : " SA1019: e.cfg.Run.Deadline is deprecated: Deadline exists for historical compatibility and should not be used."
136-
137- - path : pkg/golinters/gofumpt.go
138- text : " SA1019: settings.LangVersion is deprecated: use the global `run.go` instead."
139- - path : pkg/golinters/staticcheck_common.go
140- text : " SA1019: settings.GoVersion is deprecated: use the global `run.go` instead."
141- - path : pkg/lint/lintersdb/manager.go
142- text : " SA1019: (.+).(GoVersion|LangVersion) is deprecated: use the global `run.go` instead."
143- - path : pkg/golinters/unused.go
144- text : " rangeValCopy: each iteration copies 160 bytes \\ (consider pointers or indexing\\ )"
145- - path : test/(fix|linters)_test.go
146- text : " string `gocritic.go` has 3 occurrences, make it a constant"
147-
148- # Due to a change inside go-critic v0.10.0, some reports have been removed,
149- # but as we run analysis with the previous version of golangci-lint this leads to a paradoxical situation.
150- # This exclusion will be removed when the next version of golangci-lint (v1.56.0) will be released.
151- - path : pkg/golinters/nolintlint/nolintlint.go
152- text : " hugeParam: (i|b) is heavy \\ (\\ d+ bytes\\ ); consider passing it by pointer"
153-
154- run :
155- timeout : 5m
156- skip-dirs :
157- - test/testdata_etc # test files
158- - internal/cache # extracted from Go code
159- - internal/renameio # extracted from Go code
160- - internal/robustio # extracted from Go code
10+ disable :
11+ - wsl
12+ - nlreturn
13+ - depguard
14+ - gochecknoinits
15+ - gochecknoglobals
16+ - forbidigo
17+ - varnamelen
18+ - exhaustruct
0 commit comments