Messages in this thread Patch in this message |  | | From | Kai Wasserbäch <> | Subject | [PATCH 2/2] feat: checkpatch: Warn about Reported-by: not being followed by a Link: | Date | Sun, 4 Dec 2022 12:33:39 +0100 |
| |
Suggested-by: Thorsten Leemhuis <linux@leemhuis.info> Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org> --- scripts/checkpatch.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a6d2ccaa3e..d957e9fddf 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3144,6 +3144,20 @@ sub process { "Co-developed-by and Signed-off-by: name/email do not match \n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); } } + +# check if Reported-by: is followed by a Link: + if ($sign_off =~ /^reported-by:$/i) { + if (!defined $lines[$linenr]) { + WARN("BAD_REPORTED_BY_LINK", + "Reported-by: must be immediately followed by Link:\n" . "$here\n" . $rawline); + } elsif ($rawlines[$linenr] !~ /^\s*link:\s*(.*)/i) { + WARN("BAD_REPORTED_BY_LINK", + "Reported-by: must be immediately followed by Link:\n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + } elsif ($lines[$linenr] !~ /https?:\/\//i) { + WARN("BAD_REPORTED_BY_LINK", + "Link: following Reported-by: should contain an URL\n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + } + } } # Check Fixes: styles is correct -- 2.35.1
|  |