Skip to content

Commit a0febf7

Browse files
committed
githooks: remove unnecessary shellcheck disables
1 parent 5dd20dd commit a0febf7

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

githooks/pre-commit

+3-7
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@ exec 1>&2
2222
# Cross platform projects tend to avoid non-ASCII filenames; prevent
2323
# them from being added to the repository. We exploit the fact that the
2424
# printable range starts at the space character and ends with tilde.
25-
# disable the check to quoting the $(...) command
26-
# shellcheck disable=SC2046
2725
if [ "$allownonascii" != "true" ] &&
2826
# Note that the use of brackets around a tr range is ok here, (it's
2927
# even required, for portability to Solaris 10's /usr/bin/tr), since
3028
# the square bracket bytes happen to fall in the designated range.
31-
test $(git diff --cached --name-only --diff-filter=A -z "$against" |
32-
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
29+
test "$(git diff --cached --name-only --diff-filter=A -z "$against" |
30+
LC_ALL=C tr -d '[ -~]\0' | wc -c)" != 0
3331
then
3432
cat <<\EOF
3533
Error: Attempt to add a non-ASCII file name.
@@ -49,6 +47,4 @@ fi
4947
git diff-index --check --cached "$against" -- || exit 1
5048

5149
# Check that code lints cleanly.
52-
# disable the check to quoting the $(...) command
53-
# shellcheck disable=SC2046
54-
cargo +$(cat ./nightly-version) clippy --workspace --all-targets --all-features -- --deny warnings || exit 1
50+
cargo +"$(cat ./nightly-version)" clippy --workspace --all-targets --all-features -- --deny warnings || exit 1

0 commit comments

Comments
 (0)