fix: avoid echo usage

Echo can interpret operand as an option and checking every variable to
be echoed is troublesome while with printf, if the format specifier is
present before the operand, printing as string can be enforced.
This commit is contained in:
Ben Grande 2024-08-06 18:15:24 +02:00
parent 1b2f1ba941
commit bdd4c789c1
No known key found for this signature in database
GPG key ID: 00C64E14F51F9E56
52 changed files with 318 additions and 270 deletions

View file

@ -7,7 +7,8 @@
# shellcheck disable=SC2086
set -eu
command -v git >/dev/null || { echo "Missing program: git" >&2; exit 1; }
command -v git >/dev/null ||
{ printf '%s\n' "Missing program: git" >&2; exit 1; }
repo_toplevel="$(git rev-parse --show-toplevel)"
test -d "${repo_toplevel}" || exit 1
cd "${repo_toplevel}"
@ -34,7 +35,7 @@ fi
case "${find_tool}" in
fd|fdfind) files="$(${find_tool} . -H -t f -e py)";;
find) files="$(find . -type f -name "*.py")";;
*) echo "Unsupported find tool" >&2; exit 1;;
*) printf '%s\n' "Unsupported find tool" >&2; exit 1;;
esac
exec pylint ${files}