Skip to content
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

nolint by linter rule #2706

Closed
peakle opened this issue Mar 30, 2022 · 6 comments
Closed

nolint by linter rule #2706

peakle opened this issue Mar 30, 2022 · 6 comments
Labels
duplicate This issue or pull request already exists

Comments

@peakle
Copy link
Contributor

peakle commented Mar 30, 2022

Your feature request related to a problem? Please describe.

is some case i don't want to disable all linter checks for expression by nolint:gocritic but only one rule hugeParam for example

Describe the solution you'd like.

add feature to write nolint directive for specific rule i propose the following syntax: nolint:linter_name:check_name as example nolint:gocritic:hugeParam

Describe alternatives you've considered.

~

Additional context.

No response

@peakle peakle added the enhancement New feature or improvement label Mar 30, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Mar 30, 2022

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

@ubiuser
Copy link

ubiuser commented Nov 15, 2022

I'm also interested in this one, especially for revive.

@sebastien-rosset
Copy link
Contributor

For the gocritic example, there are three possible levels: gocritic:ruleguard:ruleguard-rule-name.
Ruleguard is a powerful checker under gocritic, and within ruleguard it's possible to have hundreds of checks.

@denisvmedia
Copy link

As for revive, it actually supports Its own ignore comments, but there're not parsed by golangci-lint. I'm wondering if we can have an API (or a convention) for the linters to support so that they can themselves ignore according to the ignore rule from golangci-lint.

I can volunteer the PR, but before starting with it we need to have a clear vision on how we want to achieve it.

@ldez
Copy link
Member

ldez commented Aug 31, 2023

Related to #1658

@ldez ldez added the area: nolint Related to nolint directive and nolintlint label Mar 21, 2024
@ldez
Copy link
Member

ldez commented Mar 21, 2024

Duplicate of #1165

@ldez ldez marked this as a duplicate of #1165 Mar 21, 2024
@ldez ldez closed this as completed Mar 21, 2024
@ldez ldez added duplicate This issue or pull request already exists and removed enhancement New feature or improvement area: nolint Related to nolint directive and nolintlint labels Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants