diff --git a/Makefile b/Makefile index 2121a2332d8..a60238394fe 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/tools/hlint.sh b/tools/hlint.sh index 84e30d837a9..e8e31d88c1f 100755 --- a/tools/hlint.sh +++ b/tools/hlint.sh @@ -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!"