Conversation
cgoldberg
left a comment
There was a problem hiding this comment.
Do you need to add --exit-non-zero-on-fix to check, and --exit-non-zero-on-format to format? We want the CI job to fail if it hits any violations.
Other than that, LGTM
Our CI job runs the format and then checks for |
|
@p0deje There are some issues that ruff won't auto-fix (like lines that are too long)... so git diff wouldn't see those. You might want to add those args to make sure it fails. |
|
@cgoldberg Hmm, I assumed that when Ruff cannot fix/format, it would fail with non-zero exit code. At least this is how I read the flag name. Will update. |
|
I'm not 100% sure what the exit code is when it can't fix... I'd have to try, but I suppose it doesn't hurt to add the flags. |
|
I did some testing and For format, there seem to be no cases when it would exit non-zero and not format files. I am going to merge this as-is, we should be safe even w/o the flags. |
Use Ruff directly to format and lint Python source code files.