@@ -231,6 +231,7 @@ maligned: Tool to detect Go structs that would take less memory if their fields
231
231
misspell: Finds commonly misspelled English words in comments [fast: true, auto-fix: true]
232
232
nakedret: Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false]
233
233
nestif: Reports deeply nested if statements [fast: true, auto-fix: false]
234
+ nolintlint: Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false]
234
235
prealloc: Finds slice declarations that could potentially be preallocated [fast: true, auto-fix: false]
235
236
rowserrcheck: checks whether Err of rows is checked successfully [fast: true, auto-fix: false]
236
237
scopelint: Scopelint checks for unpinned variables in go programs [fast: true, auto-fix: false]
@@ -496,6 +497,7 @@ golangci-lint help linters
496
497
- [godot](https://github.com/tetafro/godot) - Check if comments end in a period
497
498
- [testpackage](https://github.com/maratori/testpackage) - linter that makes you use a separate _test package
498
499
- [nestif](https://github.com/nakabonne/nestif) - Reports deeply nested if statements
500
+ - [nolintlint](https://github.com/golangci-lint/pkg/golinters/nolintlint) - Reports ill-formed or insufficient nolint directives
499
501
500
502
## Configuration
501
503
@@ -843,6 +845,17 @@ linters-settings:
843
845
simple: true
844
846
range-loops: true # Report preallocation suggestions on range loops, true by default
845
847
for-loops: false # Report preallocation suggestions on for loops, false by default
848
+ nolintlint:
849
+ # Enable to ensure that nolint directives are all used. Default is true.
850
+ allow-unused: false
851
+ # Disable to ensure that nolint directives don't have a leading space. Default is true.
852
+ allow-leading-space: true
853
+ # Exclude following linters from requiring an explanation. Default is [].
854
+ allow-no-explanation: []
855
+ # Enable to require an explanation after each nolint directive. Default is false.
856
+ require-explanation: true
857
+ # Enable to require an explanation after each nolint directive. Default is false.
858
+ require-specific: true
846
859
rowserrcheck:
847
860
packages:
848
861
- github.com/jmoiron/sqlx
@@ -1032,6 +1045,11 @@ linters-settings:
1032
1045
suggest-new: true
1033
1046
misspell:
1034
1047
locale: US
1048
+ nolintlint:
1049
+ allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
1050
+ allow-unused: false # report any unused nolint directives
1051
+ require-explanation: false # don't require an explanation for nolint directives
1052
+ require-specific: false # don't require nolint directives to be specific about which linter is being skipped
1035
1053
1036
1054
linters:
1037
1055
# please, do not use `enable-all`: it's deprecated and will be removed soon.
@@ -1062,6 +1080,7 @@ linters:
1062
1080
- lll
1063
1081
- misspell
1064
1082
- nakedret
1083
+ - nolintlint
1065
1084
- rowserrcheck
1066
1085
- scopelint
1067
1086
- staticcheck
@@ -1298,6 +1317,7 @@ Thanks to developers and authors of used linters:
1298
1317
- [tetafro](https://github.com/tetafro)
1299
1318
- [maratori](https://github.com/maratori)
1300
1319
- [nakabonne](https://github.com/nakabonne)
1320
+ - [golangci-lint](https://github.com/golangci-lint)
1301
1321
1302
1322
## Changelog
1303
1323
0 commit comments