@@ -29,7 +29,6 @@ linters:
29
29
- bodyclose # checks whether HTTP response body is closed successfully
30
30
- contextcheck # check the function whether use a non-inherited context
31
31
- decorder # check declaration order and count of types, constants, variables and functions
32
- - depguard # Go linter that checks if package imports are in a list of acceptable packages
33
32
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
34
33
- dupl # Tool for code clone detection
35
34
- durationcheck # check for two durations multiplied together
@@ -63,7 +62,6 @@ linters:
63
62
- importas # Enforces consistent import aliases
64
63
- ineffassign # Detects when assignments to existing variables are not used
65
64
- misspell # Finds commonly misspelled English words in comments
66
- - nakedret # Finds naked returns in functions greater than a specified function length
67
65
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
68
66
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value.
69
67
- noctx # noctx finds sending http request without context.Context
@@ -81,6 +79,7 @@ linters:
81
79
- wastedassign # wastedassign finds wasted assignment statements
82
80
- whitespace # Tool for detection of leading and trailing whitespace
83
81
disable :
82
+ - depguard # Go linter that checks if package imports are in a list of acceptable packages
84
83
- containedctx # containedctx is a linter that detects struct contained context.Context field
85
84
- cyclop # checks function and package cyclomatic complexity
86
85
- exhaustivestruct # Checks if all struct's fields are initialized
@@ -94,6 +93,7 @@ linters:
94
93
- maintidx # maintidx measures the maintainability index of each function.
95
94
- makezero # Finds slice declarations with non-zero initial length
96
95
- maligned # Tool to detect Go structs that would take less memory if their fields were sorted
96
+ - nakedret # Finds naked returns in functions greater than a specified function length
97
97
- nestif # Reports deeply nested if statements
98
98
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
99
99
- nolintlint # Reports ill-formed or insufficient nolint directives
@@ -111,22 +111,11 @@ linters:
111
111
issues :
112
112
exclude-use-default : false
113
113
exclude-rules :
114
- # Allow complex tests, better to be self contained
115
- - path : _test\.go
114
+ # Allow complex tests and examples , better to be self contained
115
+ - path : (examples|main\.go| _test\.go)
116
116
linters :
117
- - gocognit
118
117
- forbidigo
119
-
120
- # Allow complex main function in examples
121
- - path : examples
122
- text : " of func `main` is high"
123
- linters :
124
118
- gocognit
125
-
126
- # Allow forbidden identifiers in examples
127
- - path : examples
128
- linters :
129
- - forbidigo
130
119
131
120
# Allow forbidden identifiers in CLI commands
132
121
- path : cmd
0 commit comments