Last active
August 29, 2015 13:58
-
-
Save jhedev/9970801 to your computer and use it in GitHub Desktop.
Revisions
-
jhedev revised this gist
Apr 4, 2014 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,11 @@ # Taken from https://github.com/HIPERFIT/L0Language/blob/master/git-hooks/pre-commit fail() { echo "Aborting commit due to verification errors." echo "If you disagree, use git commit --no-verify." exit 1 } hlintable() { ! egrep -q '{-# LANGUAGE.*QuasiQuotes' $1 } -
jhedev created this gist
Apr 4, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # Taken from https://github.com/HIPERFIT/L0Language/blob/master/git-hooks/pre-commit hlintable() { ! egrep -q '{-# LANGUAGE.*QuasiQuotes' $1 } l0_hlint() { # Some hlint-suggestions are terrible, so ignore them here. hlint -i "Reduce duplication" -i "Use import/export shortcut" "$@" } # Run hlint on changed files. for file in $(git diff-index --cached --name-only HEAD | egrep '\.l?hsc?$'); do if [ -f $file ]; then if hlintable $file; then echo "Checking $file with hlint:" if ! l0_hlint "$file"; then fail fi fi fi done