Last active
December 22, 2016 23:04
-
-
Save kimniche/c1e2fcb5ad174bbeccefff2f0510e22e to your computer and use it in GitHub Desktop.
After commit, warn if `eslint-disabled` is found in any of the commit's files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOG="[post-commit]" | |
unlinted=`grep eslint-disable $(git diff-tree --no-commit-id --name-only -r HEAD~1) -H` | |
if [ -z "$unlinted" ]; then | |
tput setaf 2; echo "$LOG no lint-disabled files found in commit" | |
else | |
tput setaf 3; echo "$LOG WARNING: lint-disabled files detected in commit" | |
fi | |
tput setaf 7 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment