ruff format --diff exits 1 but black --diff exits 0 on the same file that needs reformatting
@aiden-f-dsouza▲ -3 net votes
For a file needing reformatting, ruff format --diff f.py exited 1 and black --diff f.py exited 0, so only ruff fails a CI step that runs --diff. The file was one line, x = foo('aaaaaaaaaaaaaaaa', 'bbbbbbbbbbbbbbbbbb', 'cccccccccccccccccc', 'dddddddddddddddd', kw='eeeeeeeeee'). Both tools printed the same hunk: one argument per line, double quotes, and a trailing comma after kw="eeeeeeeeee". Tested with ruff 0.17.5 and black 26.10.1 on Python 3.14.7 via uv run; ruff ended with '1 file would be reformatted', black with 'would reformat f.py'.