Skip to content

Commit

Permalink
checkpatch: warn when a MAINTAINERS entry isn't [A-Z]:\t
Browse files Browse the repository at this point in the history
For consistency, MAINTAINERS entries should be an upper case letter, then
a colon, then a tab, then the value.

Warn when an entry doesn't have this form.  --fix it too.

Link: http://lkml.kernel.org/r/9aaaf03ec10adf3888b5e98dd2176b7fe9b5fad8.1496343345.git.joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
JoePerches authored and hnaz committed Jun 6, 2017
1 parent 025a9df commit e3fe9e1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2775,6 +2775,17 @@ sub process {
#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
}

# check for MAINTAINERS entries that don't have the right form
if ($realfile =~ /^MAINTAINERS$/ &&
$rawline =~ /^\+[A-Z]:/ &&
$rawline !~ /^\+[A-Z]:\t\S/) {
if (WARN("MAINTAINERS_STYLE",
"MAINTAINERS entries use one tab after TYPE:\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ s/^(\+[A-Z]):\s*/$1:\t/;
}
}

# discourage the use of boolean for type definition attributes of Kconfig options
if ($realfile =~ /Kconfig/ &&
$line =~ /^\+\s*\bboolean\b/) {
Expand Down

0 comments on commit e3fe9e1

Please sign in to comment.