Skip to content

Commit 802b81f

Browse files
authored
Merge pull request #21 from luizm/add-sfhmt-opts
Add sfhmt opts
2 parents b8bb39b + b7b52d9 commit 802b81f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
env:
2121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2222
SHELLCHECK_OPTS: -e SC1004 # It is posible to exclude some shellcheck warnings.
23+
SHFMT_OPTS: -s # It is posible to pass arguments to shftm
2324
with:
2425
sh_checker_comment: true
2526
sh_checker_exclude: ".terraform ^dir/example.sh"

entrypoint.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ SHELLCHECK_DISABLE=0
66
SHFMT_DISABLE=0
77
SH_CHECKER_COMMENT=0
88

9-
109
if [ "${INPUT_SH_CHECKER_SHELLCHECK_DISABLE}" == "1" ] || [ "${INPUT_SH_CHECKER_SHELLCHECK_DISABLE}" == "true" ]; then
1110
SHELLCHECK_DISABLE=1
1211
fi
@@ -92,7 +91,7 @@ fi
9291
if [ "$SHFMT_DISABLE" != "1" ]; then
9392
echo -e "Validating shell scripts files using shfmt\n"
9493
# shellcheck disable=SC2086
95-
shfmt_error=$(shfmt -d $sh_files)
94+
shfmt_error="$(eval shfmt $SHFMT_OPTS -d $sh_files)"
9695
shfmt_code="$?"
9796
fi
9897

0 commit comments

Comments
 (0)