]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - scripts/checkpatch.pl
checkpatch: check for misuse of the link tags
[thirdparty/kernel/stable.git] / scripts / checkpatch.pl
index 922428ee3be5710aef2f8632ff5eb3ee3053f7c2..3e6f5a8614d3687cf470118a7701855cacdeb850 100755 (executable)
@@ -3179,7 +3179,7 @@ sub process {
                                if (!defined $lines[$linenr]) {
                                        WARN("BAD_REPORTED_BY_LINK",
                                             "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) {
+                               } elsif ($rawlines[$linenr] !~ /^closes:\s*/i) {
                                        WARN("BAD_REPORTED_BY_LINK",
                                             "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n");
                                }
@@ -3292,6 +3292,17 @@ sub process {
                        }
                }
 
+# Check for misuse of the link tags
+               if ($in_commit_log &&
+                   $line =~ /^\s*(\w+:)\s*(\S+)/) {
+                       my $tag = $1;
+                       my $value = $2;
+                       if ($tag =~ /^$link_tags_search$/ && $value !~ m{^https?://}) {
+                               WARN("COMMIT_LOG_WRONG_LINK",
+                                    "'$tag' should be followed by a public http(s) link\n" . $herecurr);
+                       }
+               }
+
 # Check for lines starting with a #
                if ($in_commit_log && $line =~ /^#/) {
                        if (WARN("COMMIT_COMMENT_SYMBOL",