Skip to content

Commit ce0338d

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: test for non-standard signatures
Warn on non-standard signature styles. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b34a26f commit ce0338d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/checkpatch.pl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,13 +1600,17 @@ sub process {
16001600

16011601
# Check signature styles
16021602
if (!$in_header_lines &&
1603-
$line =~ /^(\s*)($signature_tags)(\s*)(.*)/) {
1603+
$line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) {
16041604
my $space_before = $1;
16051605
my $sign_off = $2;
16061606
my $space_after = $3;
16071607
my $email = $4;
16081608
my $ucfirst_sign_off = ucfirst(lc($sign_off));
16091609

1610+
if ($sign_off !~ /$signature_tags/) {
1611+
WARN("BAD_SIGN_OFF",
1612+
"Non-standard signature: $sign_off\n" . $herecurr);
1613+
}
16101614
if (defined $space_before && $space_before ne "") {
16111615
WARN("BAD_SIGN_OFF",
16121616
"Do not use whitespace before $ucfirst_sign_off\n" . $herecurr);

0 commit comments

Comments
 (0)