@@ -232,6 +232,7 @@ maligned: Tool to detect Go structs that would take less memory if their fields
232232misspell: Finds commonly misspelled English words in comments [fast: true, auto-fix: true]
233233nakedret: Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false]
234234nestif: Reports deeply nested if statements [fast: true, auto-fix: false]
235+ nolintlint: Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false]
235236prealloc: Finds slice declarations that could potentially be preallocated [fast: true, auto-fix: false]
236237rowserrcheck: checks whether Err of rows is checked successfully [fast: true, auto-fix: false]
237238scopelint: Scopelint checks for unpinned variables in go programs [fast: true, auto-fix: false]
@@ -498,6 +499,7 @@ golangci-lint help linters
498499- [godot](https://github.com/tetafro/godot) - Check if comments end in a period
499500- [testpackage](https://github.com/maratori/testpackage) - linter that makes you use a separate _test package
500501- [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
501503
502504## Configuration
503505
@@ -845,6 +847,17 @@ linters-settings:
845847 simple: true
846848 range-loops: true # Report preallocation suggestions on range loops, true by default
847849 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
848861 rowserrcheck:
849862 packages:
850863 - github.com/jmoiron/sqlx
@@ -1034,6 +1047,11 @@ linters-settings:
10341047 suggest-new: true
10351048 misspell:
10361049 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
10371055
10381056linters:
10391057 # please, do not use `enable-all`: it's deprecated and will be removed soon.
@@ -1064,6 +1082,7 @@ linters:
10641082 - lll
10651083 - misspell
10661084 - nakedret
1085+ - nolintlint
10671086 - rowserrcheck
10681087 - scopelint
10691088 - staticcheck
@@ -1301,6 +1320,7 @@ Thanks to developers and authors of used linters:
13011320- [tetafro](https://github.com/tetafro)
13021321- [maratori](https://github.com/maratori)
13031322- [nakabonne](https://github.com/nakabonne)
1323+ - [golangci-lint](https://github.com/golangci-lint)
13041324
13051325## Changelog
13061326
0 commit comments