Skip to content

Commit

Permalink
Address reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Jul 11, 2024
1 parent 10664b9 commit 299868d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ jobs:
if grep -qE '^#' "$x"; then
echo "$x contains CPP. Skipping."
else
fourmolu -q -i "$x"
stylish-haskell -i "$x"
"$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x"
fi
fi
done
Expand All @@ -75,8 +74,7 @@ jobs:
if grep -qE '^#' "$x"; then
echo "$x contains CPP. Skipping."
else
fourmolu -q -i "$x"
stylish-haskell -i "$x"
"$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x"
fi
fi
done
Expand Down
25 changes: 22 additions & 3 deletions scripts/devshell/format → scripts/devshell/prettify
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,31 @@ case $1 in
;;
esac

if [[ -z $files ]]; then
echo "No files to format!"
if !(which stylish-haskell > /dev/null 2>&1); then
echo "ERROR: stylish-haskell is not available!"
echo -e
echo "Try entering the development shell with:"
echo " nix develop"
exit 1
fi

if !(which fourmolu > /dev/null 2>&1); then
echo "ERROR: fourmolu is not available!"
echo -e
show_help
echo "Try entering the development shell with:"
echo " nix develop"
exit 1
fi


if [[ -z $files ]]; then
echo "No files to format!"
if [[ -z $1 ]]; then
echo -e
show_help
exit 1
fi
fi

run_format $files

3 changes: 1 addition & 2 deletions scripts/githooks/haskell-style-lint
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ for x in $(git diff --staged --name-only --diff-filter=ACM "*.hs" | tr '\n' ' ')
if grep -qE '^#' "$x"; then
echo "$x contains CPP. Skipping."
else
fourmolu -q -i "$x"
stylish-haskell -i "$x"
"$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x"
fi
hlint "$x" || hlint_rc="1"
done
Expand Down

0 comments on commit 299868d

Please sign in to comment.