Skip to content

Commit fada7c9

Browse files
committed
check-stylish: better support for -c & -u switches
Use `fd` & ignore file list, in the same way when no option is passed.
1 parent aab8d3b commit fada7c9

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

scripts/ci/check-stylish.sh

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,8 @@ while getopts ${optstring} arg; do
3131
c)
3232
PATHS=$(git show --pretty='' --name-only HEAD)
3333
for path in $PATHS; do
34-
if [ "${path##*.}" == "hs" ]; then
35-
if grep -qE '^#' $path; then
36-
echo "$path contains CPP. Skipping."
37-
else
38-
echo $path
39-
stylish-haskell $STYLISH_HASKELL_ARGS $path
40-
fi
41-
fi
34+
echo $path
35+
fd -e hs --ignore-file ./scripts/ci/check-stylish-ignore --full-path $path -X stylish-haskell $STYLISH_HASKELL_ARGS
4236
done
4337
if [ $USE_GIT == 1 ]; then
4438
git --no-pager diff --exit-code
@@ -49,12 +43,8 @@ while getopts ${optstring} arg; do
4943
PATHS=$(git diff --name-only HEAD)
5044
for path in $PATHS; do
5145
if [ "${path##*.}" == "hs" ]; then
52-
if grep -qE '^#' $path; then
53-
echo "$path contains CPP. Skipping."
54-
else
55-
echo $path
56-
stylish-haskell $STYLISH_HASKELL_ARGS $path
57-
fi
46+
echo $path
47+
fd -e hs --ignore-file ./scripts/ci/check-stylish-ignore --full-path $path -X stylish-haskell $STYLISH_HASKELL_ARGS
5848
fi
5949
done
6050
if [ $USE_GIT == 1 ]; then

0 commit comments

Comments
 (0)