Files
scst/scripts/checkpatch_diff
Gleb Chesnokov d09f360b93 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.
2025-03-25 18:57:32 +03:00

14 lines
255 B
Bash
Executable File

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