Files
scst/scripts/checkpatch
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

26 lines
489 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
scriptpath="${CHECKPATCH_PATH:-/lib/modules/$(uname -r)/build/scripts}"
ignore=(
MISSING_SIGN_OFF
EMAIL_SUBJECT
UNKNOWN_COMMIT_ID
NO_AUTHOR_SIGN_OFF
COMMIT_LOG_USE_LINK
BAD_REPORTED_BY_LINK
FILE_PATH_CHANGES
SPDX_LICENSE_TAG
LINUX_VERSION_CODE
CONSTANT_COMPARISON
NEW_TYPEDEFS
AVOID_BUG
MACRO_ARG_REUSE
IF_0
)
ignore_str="${ignore[*]}"
"${scriptpath}/checkpatch.pl" --no-tree --show-types --strict --ignore="${ignore_str// /,}" "$@"