Skip to content

Commit e3fbc05

Browse files
committed
.golangci.yml: warn about unused nolint directives
1 parent 5cdbe12 commit e3fbc05

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ linters:
3737
- lll
3838
- misspell
3939
- nestif
40+
- nolintlint
4041
- recvcheck
4142
- revive
4243
- staticcheck
@@ -97,6 +98,9 @@ linters:
9798
nestif:
9899
# TODO: consider reducing this value.
99100
min-complexity: 12
101+
nolintlint:
102+
allow-unused: false
103+
require-specific: true
100104
revive:
101105
rules:
102106
- name: package-comments
@@ -115,6 +119,8 @@ linters:
115119
exclusions:
116120
warn-unused: true # Log a warning if an exclusion path is unused.
117121
rules:
122+
- path: (.*\.go)
123+
text: "directive `// nolint:.*` should be written without leading space"
118124
- path: (sys/.*/init.*|sys/targets/common.go)
119125
text: "don't use ALL_CAPS in Go names|should not use ALL_CAPS in Go names"
120126
- path: (prog/.*)

0 commit comments

Comments
 (0)