buildtools icon indicating copy to clipboard operation
buildtools copied to clipboard

buildozer -stdout exits 0 and outputs nothing when no changes are made

Open gholms opened this issue 11 months ago • 0 comments

When buildozer 8.0.0 runs fixes without the -stdout flag, it exits with status 3 and prints nothing when it has no changes to make. When it runs on the same BUILD file with the -stdout flag, it also outputs nothing to stdout and exits with status 0. This makes it ambiguous whether the output is missing because buildozer had nothing to do or because its altered output is legitimately an empty file.

My preference would be to have the -stdout flag always produce BUILD file content whether it was altered or not. If we need to differentiate those two cases then let's use the exit status to do that.

To reproduce this, run buildozer -stdout 'fix unusedLoads' //:__pkg__ on this project's workspace.

gholms avatar Jan 17 '25 21:01 gholms