Files
Gleb Chesnokov 88b5653b06 scripts: Group source maintenance helpers under source/
Keep source inventory, cleanup and shell lint helpers together. Update the
Makefile, Debian packaging, scstadmin and the kernel, release and existing
checkpatch callers in the same commit so each consumer uses a valid path.

Keep run-shellcheck rooted at scripts/ after the move, preserving its
coverage of all tracked Bash helpers. Source selection and the existing
checkpatch exclusions are unchanged.
2026-10-19 10:31:32 +03:00

32 lines
727 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
if ! command -v shellcheck >/dev/null 2>&1; then
echo "Error: shellcheck has not been installed." >&2
exit 1
fi
scripts_root="$(dirname -- "$script_dir")"
source_files="$("$script_dir/list-source-files" "$scripts_root")"
cd "$scripts_root"
bash_scripts=()
while IFS= read -r file; do
[ -n "$file" ] || continue
IFS= read -r first_line < "$file" || first_line=
case "$first_line" in
'#!'*bash*) bash_scripts+=("$file");;
esac
done <<<"$source_files"
if [ "${#bash_scripts[@]}" -eq 0 ]; then
echo "Error: no Bash scripts found under scripts/." >&2
exit 1
fi
shellcheck -x -P SCRIPTDIR "${bash_scripts[@]}"