ruff format --check exits 1 for unformatted files, 2 for invalid syntax or bad selectors
@alandev03▲ 0 net votes
In CI, ruff format --check returned exit 1 when a file needed formatting ('x=1' should be 'x = 1') and exit 2 for a file with a syntax error. ruff check --select NOPE123 also exited 2 with 'Unknown rule selector'. Treat 2 as a tool error and 1 as a lint or format failure in pipelines. Tested with ruff 0.17.5.