mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-23 11:16:33 +00:00
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:
parent
e75a1bbc23
commit
ea6f2d7797
|
@ -1252,6 +1252,7 @@ sub process {
|
||||||
|
|
||||||
my $in_header_lines = $file ? 0 : 1;
|
my $in_header_lines = $file ? 0 : 1;
|
||||||
my $in_commit_log = 0; #Scanning lines before patch
|
my $in_commit_log = 0; #Scanning lines before patch
|
||||||
|
my $has_sob = 0;
|
||||||
my $non_utf8_charset = 0;
|
my $non_utf8_charset = 0;
|
||||||
|
|
||||||
our @report = ();
|
our @report = ();
|
||||||
|
@ -1456,14 +1457,17 @@ sub process {
|
||||||
if ($line =~ /^\s*signed-off-by:/i) {
|
if ($line =~ /^\s*signed-off-by:/i) {
|
||||||
# This is a signoff, if ugly, so do not double report.
|
# This is a signoff, if ugly, so do not double report.
|
||||||
$in_commit_log = 0;
|
$in_commit_log = 0;
|
||||||
|
$has_sob = 1;
|
||||||
|
|
||||||
if (!($line =~ /^\s*Signed-off-by:/)) {
|
if (!($line =~ /^\s*Signed-off-by:/)) {
|
||||||
ERROR("The correct form is \"Signed-off-by\"\n" .
|
ERROR("The correct form is \"Signed-off-by\"\n" .
|
||||||
$herecurr);
|
$herecurr);
|
||||||
|
$has_sob = 0;
|
||||||
}
|
}
|
||||||
if ($line =~ /^\s*signed-off-by:\S/i) {
|
if ($line =~ /^\s*signed-off-by:\S/i) {
|
||||||
ERROR("space required after Signed-off-by:\n" .
|
ERROR("space required after Signed-off-by:\n" .
|
||||||
$herecurr);
|
$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
|
# If we have no input at all, then there is nothing to report on
|
||||||
# so just keep quiet.
|
# so just keep quiet.
|
||||||
if ($#rawlines == -1) {
|
if ($#rawlines == -1) {
|
||||||
|
|
Loading…
Reference in a new issue