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

Exit with 0 when -fix is enabled and the files to lint only contain fixable issues #430

Open
ferrarimarco opened this issue Aug 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ferrarimarco
Copy link

ferrarimarco commented Aug 10, 2024

Hi! Thanks for working on this tool :)

Currently, protolint exits with 1 if it runs with the -fix option (protolint lint -fix) against files that only have fixable issues.

Would it be possible to exit with 0 in this case? Otherwise, it's impossible to distinguish between the following cases when running protolint lint -fix:

  • Protolint found issues for rules that don't support fix mode
  • Protolint found issues that were automatically fixed

Other linters and formatters implement this behavior, and it would be useful to implement automated workflows that aim at automating fixes for rules that support that.

If possible, I would suggest implementing this with an option that only if provided, enables this behavior to avoid making this change breaking.

Thanks!

@yoheimuta
Copy link
Owner

Thank you for your suggestion.
You have a point. That looks good to me 👍

@yoheimuta yoheimuta added the enhancement New feature or request label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants