mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
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:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user