From ea6f2d7797c447e3c128b94ae7d825284a137600 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 23 Apr 2024 14:03:28 -0600 Subject: [PATCH] checkstyle9.pl: Warn if there's no SOB line If there's no Signed-off-by: line, complain. Sponsored by: Netflix --- tools/build/checkstyle9.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/build/checkstyle9.pl b/tools/build/checkstyle9.pl index df9ec2bbd7c..7fa02bcabc9 100755 --- a/tools/build/checkstyle9.pl +++ b/tools/build/checkstyle9.pl @@ -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) { -- 2.45.0