You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: build/config/.golangci.yml
+38Lines changed: 38 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ formatters:
22
22
## disabled
23
23
#- gofmt # checks if the code is formatted according to 'gofmt' command
24
24
#- golines # checks if code is formatted, and fixes long lines
25
+
#- swaggo # check if swaggo comments are formatted
25
26
26
27
linters:
27
28
default: none
@@ -37,6 +38,7 @@ linters:
37
38
- decorder # checks declaration order and count of types, constants, variables and functions
38
39
- dogsled # checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
39
40
- durationcheck # checks for two durations multiplied together
41
+
- embeddedstructfieldcheck # embedded types should be first in the struct definition
40
42
- errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases
41
43
- errchkjson # checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted
42
44
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
@@ -49,6 +51,7 @@ linters:
49
51
- goconst # finds repeated strings that could be replaced by a constant
50
52
- gocritic # provides diagnostics that check for bugs, performance and style issues
51
53
- gocyclo # computes and checks the cyclomatic complexity of functions
54
+
- godoclint # checks Golang's documentation practice (godoc)
52
55
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
53
56
- gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
54
57
- goprintffuncname # checks that printf-like functions are named with f at the end
@@ -59,10 +62,12 @@ linters:
59
62
- ineffassign # detects when assignments to existing variables are not used
60
63
- interfacebloat # checks the number of methods inside an interface
61
64
- intrange # check for loops that could use int ranges instead (Go 1.22+)
65
+
- iotamixing # checks for mixing of iota and non-iota constants in the same block
62
66
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
63
67
- makezero # finds slice declarations with non-zero initial length
64
68
- mirror # suggests alternative functions to avoid unnecessary []byte/string conversions
65
69
- misspell # finds commonly misspelled English words in comments
70
+
- modernize # suggests simplifications to Go code, using modern language and library features
66
71
- musttag # checks that struct tags are present
67
72
- nakedret # finds naked returns in functions greater than a specified function length
68
73
- nestif # reports deeply nested if statements
@@ -95,13 +100,15 @@ linters:
95
100
- whitespace # detects leading and trailing whitespace
96
101
97
102
## disabled
103
+
#- arangolint # opinionated best practices for arangodb client
98
104
#- cyclop # checks function and package cyclomatic complexity
99
105
#- depguard # [replaced by gomodguard] checks if package imports are in a list of acceptable packages
100
106
#- dupl # finds duplicated code
101
107
#- dupword # [useless without config] checks for duplicate words in the source code
102
108
#- err113 # [too strict] checks the errors handling expression
103
109
#- exhaustruct # [highly recommend to enable] checks if all structure fields are initialized
104
110
#- forcetypeassert # [replaced by errcheck] finds forced type assertions
111
+
#- funcorder # checks the order of functions, methods, and constructors
105
112
#- funlen # tool for detection of long functions
106
113
#- ginkgolinter # [if you use ginkgo/gomega] enforces standards of using ginkgo and gomega
107
114
#- gochecknoglobals # checks that no global variables exist
@@ -121,20 +128,26 @@ linters:
121
128
#- maintidx # measures the maintainability index of each function
122
129
#- mnd # detects magic numbers
123
130
#- nilnil # checks that there is no simultaneous return of nil error and an invalid value
131
+
#- noinlineerr # disallows inline error handling
124
132
#- nonamedreturns # reports all named returns
125
133
#- nlreturn # [too strict and mostly code is not more readable] checks for a new line before return and branch statements to increase code clarity
126
134
#- promlinter # checks Prometheus metrics naming via promlint
127
135
#- stylecheck # is a replacement for golint
128
136
#- tagliatelle # checks the struct tags
129
137
#- testpackage # makes you use a separate _test package
130
138
#- unparam # reports unused function parameters
139
+
#- unqueryvet # checks for SQL issues
131
140
#- usestdlibvars # detects the possibility to use variables/constants from the Go standard library
132
141
#- varnamelen # [great idea, but too many false positives] checks that the length of a variable's name matches its scope
133
142
#- wrapcheck # checks that errors returned from external packages are wrapped
134
143
#- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines
135
144
#- zerologlint # [if you use zerolog] detects the wrong usage of zerolog that a user forgets to dispatch with Send or Msg
0 commit comments