Skip to content

Instantly share code, notes, and snippets.

@gevann
Last active April 13, 2018 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gevann/c5538cb1d8e6f5da0b03ca262197b3a6 to your computer and use it in GitHub Desktop.
Save gevann/c5538cb1d8e6f5da0b03ca262197b3a6 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo
echo "Running CodeClimate"
CLIMATE_ISSUES=$(git --no-pager diff --diff-filter=ACMR --name-only master \
| xargs codeclimate analyze \
| tee /dev/tty \
| tail -n 1 \
| cut -f 4 -d' ')
if [ "$CLIMATE_ISSUES" -gt 0 ]
then
echo
echo "\033[0;31mcodeclimate > pre-commit hook failed (add --no-verify to bypass)"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment