File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 6565
6666 for x in $(git ls-tree --full-tree --name-only -r HEAD ${{ env.STYLISH_HASKELL_PATHS }}); do
6767 if [ "${x##*.}" == "hs" ]; then
68- stylish-haskell -i $x
68+ if grep -qE '^#' $x; then
69+ echo "$x contains CPP. Skipping."
70+ else
71+ stylish-haskell -i $x
72+ fi
6973 fi
7074 done
7175
7882 git fetch origin ${{ github.base_ref }} --unshallow
7983 for x in $(git diff --name-only origin/${{ github.base_ref }}..HEAD ${{ env.STYLISH_HASKELL_PATHS }}); do
8084 if [ "${x##*.}" == "hs" ]; then
81- stylish-haskell -i $x
85+ if grep -qE '^#' $x; then
86+ echo "$x contains CPP. Skipping."
87+ else
88+ stylish-haskell -i $x
89+ fi
8290 fi
8391 done
8492
Original file line number Diff line number Diff line change 44#
55# To set this script as your pre-commit hook, use the following command:
66#
7- # ln -s $(git-root)/scripts/githooks/haskell-style-lint $(git-root)/. git/hooks/pre-commit
7+ # ln -s $(git-root)/scripts/githooks/haskell-style-lint $(git rev-parse -- git-dir) /hooks/pre-commit
88#
99
1010for x in $( git diff --staged --name-only --diff-filter=ACM | tr ' \n' ' ' ) ; do
1111 if [ " ${x##* .} " = " hs" ]; then
12- stylish-haskell -i " $x "
12+ if grep -qE ' ^#' " $x " ; then
13+ echo " $x contains CPP. Skipping."
14+ else
15+ stylish-haskell -i " $x "
16+ fi
1317 # fail on linting issues
1418 hlint " $x "
1519 fi
You can’t perform that action at this time.
0 commit comments