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

Allow //nolint only with specific linter and check set and wo space #1165

Open
jirfag opened this issue May 24, 2020 · 6 comments
Open

Allow //nolint only with specific linter and check set and wo space #1165

jirfag opened this issue May 24, 2020 · 6 comments
Labels
area: nolint Related to nolint directive and nolintlint enhancement New feature or improvement
Milestone

Comments

@jirfag
Copy link
Contributor

jirfag commented May 24, 2020

Breaking change for v2. We can require not only specific linter (staticcheck), but also a specific check inside it.

@jirfag jirfag added the enhancement New feature or improvement label May 24, 2020
@jirfag jirfag added this to the v2.0.0 milestone May 24, 2020
@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No recent correspondence or work activity label Jun 2, 2021
@stale stale bot closed this as completed Jul 8, 2021
@ldez ldez reopened this Jul 8, 2021
@stale stale bot removed the stale No recent correspondence or work activity label Jul 8, 2021
@stale
Copy link

stale bot commented Jul 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No recent correspondence or work activity label Jul 10, 2022
@ldez ldez added pinned and removed stale No recent correspondence or work activity labels Jul 10, 2022
@ldez ldez added the area: nolint Related to nolint directive and nolintlint label Mar 21, 2024
@ldez ldez removed the pinned label Mar 24, 2024
@JoelSpeed
Copy link

Why would this be/does this have to be a breaking change? I came to this from looking at #2706.

The suggested format within that issue was to extend the format of the existing nolint directive

// nolint:staticcheck # Ignore all staticcheck issues

// nolint:staticcheck:subrule # Ignore only the checks generated by the subrule

I don't see how that would be breaking?

There didn't appear to be much discussion on the duplicate issue as to whether some format like this was appropriate, so I'm wondering if we could revive the idea here, what do maintainers feel about extending the existing nolint in a non-breaking way?

I suppose a key to implementing this could be how we understand which rule within a linter triggered an issue, I guess there's no standard format for that right now, and if we start enforcing a format, then perhaps that could be a breaking change for some linters?

@ldez
Copy link
Member

ldez commented Jan 23, 2025

This issue has been around for 5 years, golangci-lint has changed since the issue was opened.

nolint directives will be replaced by another directive approach.

@JoelSpeed
Copy link

Are there details of the new approach? A tracking issue?

@ldez
Copy link
Member

ldez commented Jan 23, 2025

#2706 (comment)
#1658

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 enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

3 participants