initial commit
This commit is contained in:
19
checkpatch_project.sh
Executable file
19
checkpatch_project.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
#checkpatch --no-tree -f
|
||||
checkpatch="/usr/lib/modules/$(uname -r)/build/scripts/checkpatch.pl"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
project_dir="$PWD"
|
||||
elif [ -d "$1" ]; then
|
||||
project_dir="$1"
|
||||
else
|
||||
source_file="$1"
|
||||
fi
|
||||
|
||||
if [ -z "$project_dir" ]; then
|
||||
"${checkpatch}" --no-tree -f "${source_file}"
|
||||
else
|
||||
find "${project_dir}" -regex '.*\.\(c\|h\)' -exec "${checkpatch}" --no-tree -f '{}' +
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user