-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
staticcheck lint:ignore
directives not honored
#2671
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Has there been any progress on this issue? I've just run into this issue myself, when
I tried an But as the Supporting the Thanks Owen |
duplicate of #1658 |
Using a golangci-lint directive of the form: //nolint:staticcheck // reason why staticcheck has been disabled We can disable the use of the staticcheck linter completely at the blocks or lines where is is currently reporting the use of the deprecated ast.Package stuct. This approach is documented here: https://golangci-lint.run/usage/false-positives/#nolint-directive At present golangci-lint will ignore staticheck //lint:ignore style directives. This issues has been raised with the golangci-lint team. See: golangci/golangci-lint#2671 (comment) and here: golangci/golangci-lint#1658 (comment)
Welcome
Description of the problem
As noted in #1658 (comment), staticcheck's
lint:ignore
directives are not honored within golangci-lint.At least some other linters' directives do work, including gosec's
//#nosec
and revive's//revive:disable:...
.Would be great to have this work for staticcheck, too, as linter specific directives provide means for more fine grained filtering than
//nolint:somelintercompletely
.Haven't dug through if this is something that would need to be fixed in staticcheck or golangci-lint, but starting by reporting it here :)
Version of golangci-lint
Configuration file
Go environment
Verbose output of running
For comparison
staticcheck ./...
is silent (thelint:ignore
took place).Code example or link to a public repository
The text was updated successfully, but these errors were encountered: