Skip to content

Commit

Permalink
tools/checkpatch.sh: Check the source code doesn't set executable bit
Browse files Browse the repository at this point in the history
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
  • Loading branch information
xiaoxiang781216 authored and pkarashchenko committed Feb 1, 2023
1 parent 0a66cbd commit bf5c7b6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/checkpatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf5c7b6

Please sign in to comment.