1- run :
2- timeout : 2m
3-
4- linters-settings :
5- cyclop :
6- max-complexity : 30
7- package-average : 10.0
8- errcheck :
9- check-type-assertions : true
10- funlen :
11- lines : 100
12- statements : 50
13- ignore-comments : true
14- gocognit :
15- min-complexity : 30
16- govet :
17- enable-all : true
18- disable :
19- - fieldalignment # too strict
20-
1+ version : " 2"
212linters :
22- disable-all : true
3+ default : none
234 enable :
24- # # enabled by default
25- - errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases
26- - gosimple # specializes in simplifying a code
27- - govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
28- - ineffassign # detects when assignments to existing variables are not used
29- - staticcheck # is a go vet on steroids, applying a ton of static analysis checks
30- - typecheck # like the front-end of a Go compiler, parses and type-checks Go code
31- - unused # checks for unused constants, variables, functions and types
32- # # disabled by default
33- - asciicheck # checks that your code does not contain non-ASCII identifiers
34- - bidichk # checks for dangerous unicode character sequences
35- - bodyclose # checks whether HTTP response body is closed successfully
36- - cyclop # checks function and package cyclomatic complexity
37- - dupl # tool for code clone detection
38- - durationcheck # checks for two durations multiplied together
39- - errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
40- - errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
41- - funlen # tool for detection of long functions
42- - gocognit # computes and checks the cognitive complexity of functions
43- - goconst # finds repeated strings that could be replaced by a constant
44- - gocritic # provides diagnostics that check for bugs, performance and style issues
45- - gocyclo # computes and checks the cyclomatic complexity of functions
46- - goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
47- - gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
48- - gosec # inspects source code for security problems
49- - lll # reports long lines
50- - loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
51- - makezero # finds slice declarations with non-zero initial length
52- - nakedret # finds naked returns in functions greater than a specified function length
53- - nestif # reports deeply nested if statements
54- - nilerr # finds the code that returns nil even if it checks that the error is not nil
55- - nilnil # checks that there is no simultaneous return of nil error and an invalid value
56- - noctx # finds sending http request without context.Context
57- - nolintlint # reports ill-formed or insufficient nolint directives
58- - nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL
59- - predeclared # finds code that shadows one of Go's predeclared identifiers
60- - reassign # checks that package variables are not reassigned
61- - stylecheck # is a replacement for golint
62- - usetesting # detects when some calls can be replaced by methods from the testing package
63- - testableexamples # checks if examples are testable (have an expected output)
64- - testpackage # makes you use a separate _test package
65- - tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
66- - unconvert # removes unnecessary type conversions
67- - unparam # reports unused function parameters
68- - usestdlibvars # detects the possibility to use variables/constants from the Go standard library
69- - wastedassign # finds wasted assignment statements
70- - whitespace # detects leading and trailing whitespace
71- - zerologlint # detects the wrong usage of zerolog that a user forgets to dispatch zerolog.Event
72- - decorder # checks declaration order and count of types, constants, variables and functions
73- - ginkgolinter # [if you use ginkgo/gomega] enforces standards of using ginkgo and gomega
74- - interfacebloat # checks the number of methods inside an interface
75- - tagalign # checks that struct tags are well aligned
76-
5+ - asciicheck
6+ - bidichk
7+ - bodyclose
8+ - cyclop
9+ - decorder
10+ - dupl
11+ - durationcheck
12+ - errcheck
13+ - errname
14+ - errorlint
15+ - funlen
16+ - ginkgolinter
17+ - gocognit
18+ - goconst
19+ - gocritic
20+ - gocyclo
21+ - gomoddirectives
22+ - gosec
23+ - govet
24+ - ineffassign
25+ - interfacebloat
26+ - lll
27+ - loggercheck
28+ - makezero
29+ - nakedret
30+ - nestif
31+ - nilerr
32+ - nilnil
33+ - noctx
34+ - nolintlint
35+ - nosprintfhostport
36+ - predeclared
37+ - reassign
38+ - staticcheck
39+ - tagalign
40+ - testableexamples
41+ - testpackage
42+ - tparallel
43+ - unconvert
44+ - unparam
45+ - unused
46+ - usestdlibvars
47+ - usetesting
48+ - wastedassign
49+ - whitespace
50+ - zerologlint
51+ settings :
52+ cyclop :
53+ max-complexity : 30
54+ package-average : 10
55+ errcheck :
56+ check-type-assertions : true
57+ funlen :
58+ lines : 100
59+ statements : 50
60+ ignore-comments : true
61+ gocognit :
62+ min-complexity : 30
63+ govet :
64+ disable :
65+ - fieldalignment
66+ enable-all : true
67+ exclusions :
68+ generated : lax
69+ presets :
70+ - comments
71+ - common-false-positives
72+ - legacy
73+ - std-error-handling
74+ rules :
75+ - linters :
76+ - godot
77+ source : (noinspection|TODO)
78+ - linters :
79+ - gocritic
80+ source : //noinspection
81+ - linters :
82+ - bodyclose
83+ - dupl
84+ - funlen
85+ - goconst
86+ - gosec
87+ - noctx
88+ - wrapcheck
89+ path : _test\.go
90+ - linters :
91+ - gosec
92+ text : G115
93+ - linters :
94+ - staticcheck
95+ text : SA5011
96+ - path : (.+)\.go$
97+ text : declaration of "(err|ctx)" shadows declaration at
98+ paths :
99+ - third_party$
100+ - builtin$
101+ - examples$
77102issues :
78103 max-same-issues : 0
79- exclude :
80- - ' declaration of "(err|ctx)" shadows declaration at' # shadowing of err and ctx is acceptable
81- exclude-rules :
82- - source : " (noinspection|TODO)"
83- linters : [ godot ]
84- - source : " //noinspection"
85- linters : [ gocritic ]
86- - path : " _test\\ .go"
87- linters :
88- - bodyclose
89- - dupl
90- - funlen
91- - goconst
92- - gosec
93- - noctx
94- - wrapcheck
95- - linters : [gosec]
96- text : " G115"
97- - linters :
98- - staticcheck
99- text : " SA5011" # SA5011: Should not use unsafe.Pointer - this throws false positives when a nil check does not result in a return
104+ formatters :
105+ enable :
106+ - goimports
107+ exclusions :
108+ generated : lax
109+ paths :
110+ - third_party$
111+ - builtin$
112+ - examples$
0 commit comments