Skip to content

Commit 04db4d2

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: complain about executable files
Complain about files with an executable bit set that are not in a scripts/ directory and are not type .pl, .py, .awk, or .sh Based on an initial patch from Stephen. Signed-off-by: Joe Perches <[email protected]> Acked-by: Stephen Boyd <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a6962d7 commit 04db4d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/checkpatch.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,8 @@ sub process {
15831583
# Check for incorrect file permissions
15841584
if ($line =~ /^new (file )?mode.*[7531]\d{0,2}$/) {
15851585
my $permhere = $here . "FILE: $realfile\n";
1586-
if ($realfile =~ /(Makefile|Kconfig|\.c|\.h|\.S|\.tmpl)$/) {
1586+
if ($realfile !~ m@scripts/@ &&
1587+
$realfile !~ /\.(py|pl|awk|sh)$/) {
15871588
ERROR("EXECUTE_PERMISSIONS",
15881589
"do not set execute permissions for source files\n" . $permhere);
15891590
}

0 commit comments

Comments
 (0)