-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Idea: Allow linters to be "warn only" #708
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
Comments
You could also perform two separate runs with separate configuration files, and treat the results however you want. That would allow you more flexibility, such as having both warning and error settings for a given linter. At the cost, of course, of having two configs to maintain. |
I don't believe in warnings as a part of production process (CI, etc). It's a nice thing to see warnings sometimes. But a stable process can be based only on failure if there are any issues. I agree with @snargleplax that you can run |
We have a similar need. Currently golangci-lint will fail because of the deprecation warnings. To allow deprecations and not fail CI, we currently can only disable the whole linter for the line ( It would be great to be able to configure similar to the issues rules, issues that are only warnings and won't result in failed check. Running golangci-lint twice is not a practical solution:
|
@fho Hushing specific issues within a linter seems like a separable thing, larger than what the OP was after here. My $0.02 would be not to lump it in here, related though it may be. |
@snargleplax to me it sounds like the exact same use-case. We both want to have certain linter errors handled as "warnings" (displayed but not breaking the build). Sure, my current use-case is not deprecating methods but allowing soft-migrations but in the end that doesn't differ that much. |
|
@Luzifer: It's not identical based on the issue as written. Ignoring entire linters is different (and simpler) than adding the ability to ignore specific issues within a linter. |
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. |
Can this be reopened or is there a more appropriate location to continue the discussion. The use of levels (for example,
|
Thanks for that @bombsimon ! I did trawl but evidently my mojo wasn't so good (neither tickets were previously mentioned here). Will see how we roll with it! Thanks! |
@bombsimon QQ on follow up, we've configured info level for some linters, however, the CLI is still returning a non-0 value if they are hit. Obviously this has some issues for CICD.
cc: @lawko95 |
@jufemaiz is there any solution for this by now? I set some rules to |
@doron-cohen worthwhile joining in the discussion @ #1981 |
After
godox
linter was added I'm having an error which is not yet fixable in my code:Seeing this TODO comment in the lint is great because it reminds me I need to do something about that. Sadly the issue was prioritized as "lets do this later" as it is not a business critical issue.
Therefore having an option to set (for example)
godox
as awarn only
linter which reminds me I need to do something but does not fail the linter (if there are onlywarn only
errors left, exit with status 0 instead of 1) would be great.Sure I also could just add a
//nolint:godox
but that would also make the output vanish…The text was updated successfully, but these errors were encountered: