scripts: Fix shellcheck warnings for checkpatch scripts

- Switching from 'set -e' to 'set -euo pipefail' for better error handling.
- Quoting all variable expansions to prevent word splitting and globbing.
- Replacing legacy unquoted $(...) and $@ with quoted forms.
- Using array-safe idioms where necessary (e.g., "${src_files[@]}").

This patch doesn't change any functionality.
This commit is contained in:
Gleb Chesnokov
2025-03-25 17:15:15 +03:00
parent 2e92bd0bb3
commit d09f360b93
4 changed files with 30 additions and 30 deletions

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -e
set -euo pipefail
rootdir=$(readlink -f $(dirname $0)/..)
scriptsdir=${rootdir}/scripts
base_commit=${1:-master}
rootdir="$(readlink -f "$(dirname "$0")/..")"
scriptsdir="${rootdir}/scripts"
base_commit="${1:-master}"
err=0
(cd ${rootdir} && git diff ${base_commit} | ${scriptsdir}/checkpatch -) || err=1
(cd "${rootdir}" && git diff "${base_commit}" | "${scriptsdir}/checkpatch" -) || err=1
exit $err
exit "${err}"