diff options
author | Joe Perches <joe@perches.com> | 2014-08-06 19:10:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 21:01:28 -0400 |
commit | 13f1937ef33950b1112049972249e6191b82e6c9 (patch) | |
tree | dba316604279ac779331517b8d3b331704121f79 /scripts | |
parent | d311cd44545f2f69749c68d6723360b4cc21cd02 (diff) |
checkpatch: emit a warning on file add/move/delete
Whenever files are added, moved, or deleted, the MAINTAINERS file
patterns can be out of sync or outdated.
To try to keep MAINTAINERS more up-to-date, add a one-time warning
whenever a patch does any of those.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 496f9abdb930..0cf8b98d8dc9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1679,7 +1679,7 @@ sub process { | |||
1679 | 1679 | ||
1680 | my $in_header_lines = $file ? 0 : 1; | 1680 | my $in_header_lines = $file ? 0 : 1; |
1681 | my $in_commit_log = 0; #Scanning lines before patch | 1681 | my $in_commit_log = 0; #Scanning lines before patch |
1682 | 1682 | my $reported_maintainer_file = 0; | |
1683 | my $non_utf8_charset = 0; | 1683 | my $non_utf8_charset = 0; |
1684 | 1684 | ||
1685 | my $last_blank_line = 0; | 1685 | my $last_blank_line = 0; |
@@ -2012,6 +2012,17 @@ sub process { | |||
2012 | "Please use 12 to 16 chars for the git commit ID like: '${init_char}ommit $id (\"$desc\")'\n" . $herecurr); | 2012 | "Please use 12 to 16 chars for the git commit ID like: '${init_char}ommit $id (\"$desc\")'\n" . $herecurr); |
2013 | } | 2013 | } |
2014 | 2014 | ||
2015 | # Check for added, moved or deleted files | ||
2016 | if (!$reported_maintainer_file && !$in_commit_log && | ||
2017 | ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ || | ||
2018 | $line =~ /^rename (?:from|to) [\w\/\.\-]+\s*$/ || | ||
2019 | ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ && | ||
2020 | (defined($1) || defined($2))))) { | ||
2021 | $reported_maintainer_file = 1; | ||
2022 | WARN("FILE_PATH_CHANGES", | ||
2023 | "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr); | ||
2024 | } | ||
2025 | |||
2015 | # Check for wrappage within a valid hunk of the file | 2026 | # Check for wrappage within a valid hunk of the file |
2016 | if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { | 2027 | if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { |
2017 | ERROR("CORRUPTED_PATCH", | 2028 | ERROR("CORRUPTED_PATCH", |