Skip to content

Commit

Permalink
checkpatch: allow Closes tags with links
Browse files Browse the repository at this point in the history
As a follow-up of a previous patch modifying the documentation to
allow using the "Closes:" tag, checkpatch.pl is updated accordingly.

checkpatch.pl now no longer complain when the "Closes:" tag is used by
itself:

  commit 76f381b ("checkpatch: warn when unknown tags are used for links")

... or after the "Reported-by:" tag:

  commit d7f1d71 ("checkpatch: warn when Reported-by: is not followed by Link:")

Closes: multipath-tcp/mptcp_net-next#373
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
  • Loading branch information
matttbe authored and intel-lab-lkp committed Apr 3, 2023
1 parent 6e1eb3c commit b0cfd29
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ sub hash_show_words {
Cc:
)};

our @link_tags = qw(Link);
our @link_tags = qw(Link Closes);

#Create a search and print patterns for all these strings to be used directly below
our $link_tags_search = "";
Expand Down Expand Up @@ -3174,14 +3174,14 @@ sub process {
}
}

# check if Reported-by: is followed by a Link:
# check if Reported-by: is followed by a Closes: tag
if ($sign_off =~ /^reported(?:|-and-tested)-by:$/i) {
if (!defined $lines[$linenr]) {
WARN("BAD_REPORTED_BY_LINK",
"Reported-by: should be immediately followed by Link: with a URL to the report\n" . $herecurr . "\n");
} elsif ($rawlines[$linenr] !~ m{^link:\s*https?://}i) {
"Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . "\n");
} elsif ($rawlines[$linenr] !~ m{^closes:\s*https?://}i) {
WARN("BAD_REPORTED_BY_LINK",
"Reported-by: should be immediately followed by Link: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n");
"Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n");
}
}
}
Expand Down

0 comments on commit b0cfd29

Please sign in to comment.