houseabsolute / precious

One code quality tool to rule them all
Apache License 2.0
82 stars 4 forks source link

Improve docs around handling of stdout and stderr #11

Closed autarch closed 3 years ago

autarch commented 3 years ago

From a $WORK discussion of a command configuration:

We may not want to pass the -q flag here. Precious will (intentionally) trap all stdout and stderr output of the commands it runs.

If a command outputs to stdout, you will be able to see that in A) debug mode; or B) output from precious when the commands exits with an unexpected error code.

By default, precious treats any output stderr as abnormal, and causes it to consider that linter/tidier to have failed. However, you can set expect_stderr = true for tools which print to stderr under "normal" operation. In that case, it does the same thing as it does stdout.

All of which is to say that in general there's no value to running a command in quiet mode with precious. All that does it potentially make it harder to debug issues with that command.

It'd be good to explain this in the docs and recommend people configure commands in non-quiet mode (and maybe in verbose mode, but that depends on the command).