macisamuele / language-formatters-pre-commit-hooks

Collection of custom pre-commit hooks.
Apache License 2.0
115 stars 58 forks source link

Update `run_command` to return stdout and stderr separately #170

Closed macisamuele closed 1 year ago

macisamuele commented 1 year ago

The current implementation of language_formatters_pre_commit_hooks.utils.run_command squashes stdout and stderr in the same str.

As far as this worked generally fine, it causes some friction when we need to be able to discriminate the two streams (like in #162 ).

The goal of this PR is to effectively split the two streams into separate strings such that tools can effectively do determinations on them. While doing so I've also simplified _is_command_success helper, as it was made more generic than actually used, hence no reason to keep that around.