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:
parent
7ecfcf5814
commit
03e6c47086
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue