Skip to content

Commit c22aea5

Browse files
committed
Merge rust-bitcoin#3144: githooks: remove unnecessary shellcheck disables
a0febf7 githooks: remove unnecessary shellcheck disables (Jose Storopoli) Pull request description: We don't need to worry about nested quoting in SC2046. Thanks to Kixunil in rust-bitcoin/rust-secp256k1#697 for pointing that out. ACKs for top commit: Kixunil: ACK a0febf7 tcharding: ACK a0febf7 apoelstra: ACK a0febf7 successfully ran local tests Tree-SHA512: 83cdcc55c7e7922c05f5e78305086595a96745f34ea68ee99ed1c08c97683bd45d3c62e8d8b4bcba6b0572c9c65178ff4e21abd7178e2e8b0c9e42f4b25508fb
2 parents 8ac0e60 + a0febf7 commit c22aea5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

githooks/pre-commit

Lines changed: 3 additions & 7 deletions
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)