Skip to content

Commit

Permalink
check-stylish: better support for -c & -u switches
Browse files Browse the repository at this point in the history
Use `fd` & ignore file list, in the same way when no option is passed.
  • Loading branch information
coot committed Sep 20, 2024
1 parent aab8d3b commit fada7c9
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions scripts/ci/check-stylish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,8 @@ while getopts ${optstring} arg; do
c)
PATHS=$(git show --pretty='' --name-only HEAD)
for path in $PATHS; do
if [ "${path##*.}" == "hs" ]; then
if grep -qE '^#' $path; then
echo "$path contains CPP. Skipping."
else
echo $path
stylish-haskell $STYLISH_HASKELL_ARGS $path
fi
fi
echo $path
fd -e hs --ignore-file ./scripts/ci/check-stylish-ignore --full-path $path -X stylish-haskell $STYLISH_HASKELL_ARGS
done
if [ $USE_GIT == 1 ]; then
git --no-pager diff --exit-code
Expand All @@ -49,12 +43,8 @@ while getopts ${optstring} arg; do
PATHS=$(git diff --name-only HEAD)
for path in $PATHS; do
if [ "${path##*.}" == "hs" ]; then
if grep -qE '^#' $path; then
echo "$path contains CPP. Skipping."
else
echo $path
stylish-haskell $STYLISH_HASKELL_ARGS $path
fi
echo $path
fd -e hs --ignore-file ./scripts/ci/check-stylish-ignore --full-path $path -X stylish-haskell $STYLISH_HASKELL_ARGS
fi
done
if [ $USE_GIT == 1 ]; then
Expand Down

0 comments on commit fada7c9

Please sign in to comment.