Skip to content

feature request: warn on //nolint:typecheck #5005

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
2 of 3 tasks
vegerot opened this issue Sep 10, 2024 · 3 comments
Closed
2 of 3 tasks

feature request: warn on //nolint:typecheck #5005

vegerot opened this issue Sep 10, 2024 · 3 comments
Assignees
Labels
area: nolint Related to nolint directive and nolintlint won't fix This will not be worked on

Comments

@vegerot
Copy link

vegerot commented Sep 10, 2024

Welcome

Your feature request related to a problem? Please describe

I spent twenty minutes today trying to figure out why //nolint:typecheck was being ignored in my project. I was about to report an issue for //nolint:typecheck being ignored, when I read the FAQ and saw that this was the intended behavior.

I wish I hadn't wasted twenty minutes figuring out what was wrong.

Describe the solution you'd like

When encountering a //nolint:typecheck golangci-lint should emit a warning saying this directive will be ignored and link to the FAQ.

Describe alternatives you've considered

We could also emit an error when using //nolint:typecheck, but that sounds too extreme

Additional context

No response

Supporter

@vegerot vegerot added the enhancement New feature or improvement label Sep 10, 2024
Copy link

boring-cyborg bot commented Sep 10, 2024

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@vegerot vegerot changed the title warn on //nolint:typecheck feature request: warn on //nolint:typecheck Sep 10, 2024
@ldez ldez added question Further information is requested area: nolint Related to nolint directive and nolintlint and removed enhancement New feature or improvement question Further information is requested labels Sep 10, 2024
@ldez ldez self-assigned this Sep 10, 2024
@vegerot
Copy link
Author

vegerot commented Sep 10, 2024

extra credit:

When reporting a typecheck error, if the line has //nolint:all, we should provide an extra warning saying "I see you put //nolint:all here, but this is ignored because of "

@ldez ldez added the won't fix This will not be worked on label Sep 10, 2024
@ldez
Copy link
Member

ldez commented Sep 10, 2024

Hello,

To be able to detect the directives, we need to analyze the code, but as typecheck errors block the analysis, it's impossible to detect the directives.

So I understand the issue but there is no solution.

FYI, I recently added a new question/answer inside the FAQ: https://golangci-lint.run/welcome/faq/#why-is-it-not-possible-to-skipignore-typecheck-errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: nolint Related to nolint directive and nolintlint won't fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants