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