From bf5c7b6e5d2a47ae4fb5b823eb8754216034b6eb Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 1 Feb 2023 07:37:10 +0800 Subject: [PATCH] tools/checkpatch.sh: Check the source code doesn't set executable bit Signed-off-by: Xiang Xiao --- tools/checkpatch.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh index 13dd0e67f4..65952d986f 100755 --- a/tools/checkpatch.sh +++ b/tools/checkpatch.sh @@ -59,6 +59,17 @@ is_rust_file() { } check_file() { + if [ -x $@ ]; then + case $@ in + *.bat | *.sh | *.py) + ;; + *) + echo "$@: error: execute permissions detected!" + fail=1 + ;; + esac + fi + if [ "$(is_rust_file $@)" == "1" ]; then if ! command -v rustfmt &> /dev/null; then fail=1