yoheimuta / protolint

A pluggable linter and fixer to enforce Protocol Buffer style and conventions.
MIT License
555 stars 51 forks source link

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

Open ferrarimarco opened 1 month ago

ferrarimarco commented 1 month ago

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:

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 commented 1 month ago

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