Skip to content

Commit

Permalink
Added hlint pr check makefile cmd. (#2690)
Browse files Browse the repository at this point in the history
  • Loading branch information
elland authored Sep 15, 2022
1 parent abe85c6 commit b46398f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ ghcid:
hlint-check-all:
./tools/hlint.sh -f all -m check

.PHONY: hlint-check-pr
hlint-check-pr:
./tools/hlint.sh -f pr -m check

.PHONY: hlint-inplace-pr
hlint-inplace-pr:
./tools/hlint.sh -f pr -m inplace


.PHONY: hlint-inplace-all
hlint-inplace-all:
./tools/hlint.sh -f all -m inplace
Expand Down
3 changes: 3 additions & 0 deletions tools/hlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ while getopts ':f:m:' opt
if [ "$f" = "all" ]; then
files=$(find libs/ services/ -not -path "*/test/*" -name "*.hs")
echo "WARNING: not linting tests."
elif [ "$f" = "pr" ]; then
files=$(git diff --name-only origin/develop... | grep \.hs\$)
echo "WARNING: linting test files with changes. This may lead to some hard to fix warnings/errors, it is safe to ignore those!"
elif [ "$f" = "changeset" ]; then
files=$(git diff --name-only HEAD | grep \.hs\$)
echo "WARNING: linting test files with changes. This may lead to some hard to fix warnings/errors, it is safe to ignore those!"
Expand Down

0 comments on commit b46398f

Please sign in to comment.