tools/checkpatch.sh: Check the source code doesn't set executable bit

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-02-01 07:37:10 +08:00 committed by Petro Karashchenko
parent 0a66cbdcdd
commit bf5c7b6e5d
1 changed files with 11 additions and 0 deletions

View File

@ -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