checkstyle9.pl: Warn if there's no SOB line

If there's no Signed-off-by: line, complain.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2024-04-23 14:03:28 -06:00
parent e75a1bbc23
commit ea6f2d7797

View File

@ -1252,6 +1252,7 @@ sub process {
my $in_header_lines = $file ? 0 : 1;
my $in_commit_log = 0; #Scanning lines before patch
my $has_sob = 0;
my $non_utf8_charset = 0;
our @report = ();
@ -1456,14 +1457,17 @@ sub process {
if ($line =~ /^\s*signed-off-by:/i) {
# This is a signoff, if ugly, so do not double report.
$in_commit_log = 0;
$has_sob = 1;
if (!($line =~ /^\s*Signed-off-by:/)) {
ERROR("The correct form is \"Signed-off-by\"\n" .
$herecurr);
$has_sob = 0;
}
if ($line =~ /^\s*signed-off-by:\S/i) {
ERROR("space required after Signed-off-by:\n" .
$herecurr);
$has_sob = 0;
}
}
@ -2649,6 +2653,10 @@ sub process {
}
if ($has_sob == 0) {
ERROR("Missing Signed-off-by: line");
}
# If we have no input at all, then there is nothing to report on
# so just keep quiet.
if ($#rawlines == -1) {