Skip to content

File-wide ignore specific linter rules #521

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

Closed
temoto opened this issue Apr 28, 2019 · 2 comments
Closed

File-wide ignore specific linter rules #521

temoto opened this issue Apr 28, 2019 · 2 comments

Comments

@temoto
Copy link

temoto commented Apr 28, 2019

Hello. Thanks for great linter tool.

Is it possible to specify file-wide ignore of specific linter (or specific rules) in that file comment, as opposed to in config?

golangci-lint --version
Error: unknown flag: --version

I like to think it's version v1.16.0 because installed with module-enabled go get.

jirfag added a commit that referenced this issue Jun 9, 2019
Also, add more tests for block-wise
usage of //nolint.
jirfag added a commit that referenced this issue Jun 9, 2019
Also, add more tests for block-wise
usage of //nolint.
@jirfag
Copy link
Contributor

jirfag commented Jun 9, 2019

Hi! Yes, it's possible:

//nolint:govet
package pkg

I've improved README about //nolint in the #560.

@jirfag jirfag closed this as completed Jun 9, 2019
jirfag added a commit that referenced this issue Jun 9, 2019
Also, add more tests for block-wise
usage of //nolint.
jirfag added a commit that referenced this issue Jun 9, 2019
Also, add more tests for block-wise
usage of //nolint.
@Harkishen-Singh
Copy link

Harkishen-Singh commented Sep 1, 2020

This does not work for me at least. I added //nolint:govet to the top of the file and it still shows up in golangci-lint run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants