Skip to content

Commit

Permalink
Tweak ormolu script. (#998)
Browse files Browse the repository at this point in the history
- don't choke in check mode, but report all errors.
- in check mode in case of error, give hints on how to fix this.
  • Loading branch information
fisx authored Mar 2, 2020
1 parent 0f80653 commit b19ee99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/ormolu.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash

set -e
cd "$( dirname "${BASH_SOURCE[0]}" )/.."

ORMOLU_VERSION=$(perl -ne '/^- ormolu-([^\s]+)(\s|$)/ && print $1' stack.yaml)
Expand Down Expand Up @@ -77,5 +76,8 @@ done

if [ "$FAILURES" != 0 ]; then
echo "ormolu failed on $FAILURES files."
if [ "$ARG_ORMOLU_MODE" == "check" ]; then
echo -en "\n\nyou can fix this by running 'make format' from the git repo root.\n\n"
fi
exit 1
fi

0 comments on commit b19ee99

Please sign in to comment.