Skip to content

Instantly share code, notes, and snippets.

@obrok
Created May 21, 2012 22:54
Show Gist options
  • Save obrok/2765218 to your computer and use it in GitHub Desktop.
Save obrok/2765218 to your computer and use it in GitHub Desktop.
Tool to run an appropriate lint on every modified file
#!/bin/bash
# Requirements:
# - node.js (brew install node || open http://nodejs.org/dist/v0.6.18/node-v0.6.18.pkg)
# - jslint (brew install jslint)
# - coffeelint (npm install -g coffeelint)
# - csslint (npm install -g csslint)
# - reek (gem install reek)
for file in `git status -s | awk '{ print $2 }'`
do
echo
echo "###############################################################"
echo $file
echo "###############################################################"
case ${file##*.} in
rb)
reek $file
;;
js)
jsl -process $file
;;
coffee)
coffeelint $file
;;
css)
csslint $file
;;
esac
done
@nbartlomiej
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment