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

fix: nolintlint comment analysis. #1571

Merged
merged 6 commits into from
Dec 22, 2020
Merged

Conversation

ldez
Copy link
Member

@ldez ldez commented Dec 21, 2020

Fixes #1566

@ldez ldez added the bug Something isn't working label Dec 21, 2020
@ldez ldez requested a review from ashanbrown December 21, 2020 17:41
@ldez ldez marked this pull request as draft December 21, 2020 17:48
@ldez ldez marked this pull request as ready for review December 21, 2020 17:51
@ashanbrown
Copy link
Contributor

I noticed that there are still some references to c.List[0].Text which I think might be inconsistent with the new directive variable. I think we might just want to iterate over each element of c.List and create a nolint issue from each comment. This might also be more correct than the existing code is, since my guess is that we probably are not covering the case of multiple directives, such as:

//nolint
//go:something
< my expression >

(We could probably write a test to demonstrate this).

@ldez ldez marked this pull request as draft December 21, 2020 18:03
@ldez ldez force-pushed the fix/nolintlint-comment branch 2 times, most recently from 08e72d5 to 7243cf3 Compare December 21, 2020 19:37
@ldez ldez marked this pull request as ready for review December 21, 2020 19:49
@ldez ldez added the linter: update version Update version of linter label Dec 21, 2020
@ldez
Copy link
Member Author

ldez commented Dec 21, 2020

Copy link
Contributor

@ashanbrown ashanbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ldez ldez merged commit be02979 into golangci:master Dec 22, 2020
@ldez ldez deleted the fix/nolintlint-comment branch December 22, 2020 00:24
@ldez ldez added this to the v1.34 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linter: update version Update version of linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nolintlint: "allow no explanation" broken since v1.31.0
2 participants