chiark / gitweb /
pre-commit: fix warnings and errors
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 13 Jul 2016 11:07:03 +0000 (12:07 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 13 Jul 2016 11:15:22 +0000 (12:15 +0100)
commitd8a8c2458461fb0fc035d0c9a606cf76f7757057
tree5165899c67b0e57f912a670a815dac44980a7b78
parent64d9eb3b13a1be316d3309f2d1fa43be02b1afe3
pre-commit: fix warnings and errors

Properly print warnings to stderr. Also, use : instead of 'echo' as a
fallback as the latter spits out garbage to stdout.

Examples without pep8 installed.

Before:

 $ ./hooks/pre-commit
./hooks/pre-commit: line 97: WARNING:: command not found
ERROR: pep8 tests failed!

After:

 $ ./hooks/pre-commit
WARNING: pep8 is not installed, using dummy placeholder!
hooks/pre-commit