jish / pre-commit

A slightly improved pre-commit hook for git
https://jish.github.io/pre-commit/
Other
796 stars 96 forks source link

Ignore standard error when checking grep version #266

Closed jish closed 6 years ago

jish commented 6 years ago

We are currently shelling out to the grep command for some functionality of the pre-commit gem. In order to do this we need to reason about the grep executable running on the system.

To introspect the command we check the output of the grep --version command and decide what to do next. On Alpine Linux grep does not report its version and instead outputs an error message. Here we ignore the standard error stream when checking grep's version.

fixes #265 @fgrehm

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.007%) to 97.326% when pulling c2d09b6807bd041749c9f87adfe4c6faa8aaa28f on grep-version into ec99266a8828d7cb2feea806048681e9e870dda9 on master.

fgrehm commented 6 years ago

Thanks!