Created
June 10, 2010 08:54
-
-
Save mpdaugherty/432727 to your computer and use it in GitHub Desktop.
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
# Turn off ambiguous end of line errors; they conflict with standard jQuery syntax | |
-ambiguous_newline |
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
# cd into the root code directory | |
cd `git rev-parse --show-cdup`. | |
diffJSFiles=`git diff origin/master HEAD --name-only | grep "\.js$"` | |
echo "Validating Javascript Files with JS Lint:" | |
echo "$diffJSFiles" | |
jsPassed=0 | |
for jsFile in $diffJSFiles; do | |
# Replace bin/jslint/jsl below with the path to jsl on your system. I added it to our | |
# repository so that new developers wouldn't have to set anything up and this script would | |
# immediately work | |
if bin/jslint/jsl -process $jsFile -conf bin/jslint/jsl.conf 2>&1 | grep 'lint' ; then | |
jsPassed=1 | |
fi | |
done | |
if [ $jsPassed = 1 ] | |
then | |
echo "JSLint failed. Refusing push." | |
exit 1 | |
fi | |
echo 'JSLint Succeeded - Pushing' | |
git push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment