cool-easter-32542
05/10/2024, 4:21 PMpants fix fmt lint and it applies autofixes it doesn't exit with 1. We need pre-commit to fail so the developer has a chance to include those fixes in the commit.
By contrast, ruff has a --exit-non-zero-on-fix flag which allows this to be differentiated.
Describe the solution you'd like
Maybe some global setting like pants --exit-non-zero-on-fix fix fmt
Then when autoformating or autofixing occurs the exit code is non-zero failing notifying the caller there were some issues.
Describe alternatives you've considered
Inspecting changed files and parsing output from pants. This is not ideal.
I guess we could do pants lint fix fmt as long as it runs lint first then the next goals. However, the output can be confusing for developers if some lint failures were autofixed.
pantsbuild/pants