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

Unknown linter breaks //nolint #1497

Merged
merged 2 commits into from Nov 9, 2020
Merged

Conversation

iwankgb
Copy link
Contributor

@iwankgb iwankgb commented Nov 6, 2020

Fixes #1450 by applying //nolint directive to a non-existent linter only.

@iwankgb iwankgb marked this pull request as draft November 6, 2020 19:59
@iwankgb
Copy link
Contributor Author

iwankgb commented Nov 6, 2020

@golangci/team this PR is a breaking change, at least formally: at the moment when //nolint directive refers to non-existing linter, then:

  • exit status will be 0.
  • no violations from other linters will be reported for the line.

Is such change fine with us? I agree that it might force some people to do some extra work but I strongly believe that it is a valid bugfix too.

@iwankgb iwankgb force-pushed the unknown_linter_breaks_nolint branch from 73679ab to efeeefc Compare November 6, 2020 20:05
@iwankgb iwankgb force-pushed the unknown_linter_breaks_nolint branch from efeeefc to 105a35c Compare November 6, 2020 20:06
Copy link
Contributor

@invidian invidian left a comment

Choose a reason for hiding this comment

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

For me, if one specifies invalid linter in //nolint:, it should throw an error (or, a linter warning), instead of be silent and do nothing.

@iwankgb
Copy link
Contributor Author

iwankgb commented Nov 7, 2020

Warning has always been displayed and I am not going to change it.

@iwankgb iwankgb self-assigned this Nov 7, 2020
@iwankgb iwankgb marked this pull request as ready for review November 7, 2020 19:53
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

LGTM

@iwankgb iwankgb merged commit 947dae1 into master Nov 9, 2020
@delete-merged-branch delete-merged-branch bot deleted the unknown_linter_breaks_nolint branch November 9, 2020 08:33
@ldez ldez added this to the v1.33 milestone Mar 6, 2024
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

Successfully merging this pull request may close these issues.

Treat "Found unknown linters" warning as an error
4 participants