protolint icon indicating copy to clipboard operation
protolint copied to clipboard

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

Open ferrarimarco opened this issue 1 year ago • 1 comments

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!

ferrarimarco avatar Aug 10 '24 16:08 ferrarimarco

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

yoheimuta avatar Aug 13 '24 01:08 yoheimuta