pre-commit hook: fix shellcheck SCSC2181

Check exit code directly with e.g. if mycmd;
not indirectly with $?

https://github.com/koalaman/shellcheck/wiki/SC2181
This commit is contained in:
teutat3s 2022-04-09 15:42:36 +02:00
parent 7ecfcf5814
commit 03e6c47086
Signed by untrusted user: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -20,8 +20,7 @@ if [[ -n "${nix_files[@]}" ]]; then
fi fi
# check editorconfig # check editorconfig
editorconfig-checker -- "${all_files[@]}" if ! editorconfig-checker -- "${all_files[@]}"; then
if [[ $? != '0' ]]; then
printf "%b\n" \ printf "%b\n" \
"\nCode is not aligned with .editorconfig" \ "\nCode is not aligned with .editorconfig" \
"Review the output and commit your fixes" >&2 "Review the output and commit your fixes" >&2