Skip to contentSkip to conversation

checkpatch: Avoid warnings for numbered references with URL

PATCH In review Anton Leontiev 2 participants 2 messages Sep 2, 2023 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: Avoid warnings for numbered references with URL

Numbered references is one of the most frequently used ways to link external resources and them often exeed 75 chars. Add exception for these lines.

---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
scripts/checkpatch.pl +2 -0
index 7d16f863edf1..929574f43d4d 100755
@@ -3270,6 +3270,8 @@ sub process {
 					# filename then :
 		      $line =~ /^\s*(?:Fixes:|$link_tags_search|$signature_tags)/i ||
 					# A Fixes:, link or signature tag line
+		      $line =~ /^\s*\[\d+\]\s+[a-z][\w\.\+\-]*:\/\/\S+/i ||
+					# reference with URL
 		      $commit_log_possible_stack_dump)) {
 			WARN("COMMIT_LOG_LONG_LINE",
 			     "Prefer a maximum 75 chars per line (possible unwrapped commit description?)\n" . $herecurr);
Signature · 1 line
2.41.0
maintainer
#1 lore raw
Quoted 3 lines · Anton Leontiev

Numbered references is one of the most frequently used ways to link external resources and them often exeed 75 chars. Add exception for these lines.

Conceptually ok, but there are other non-numbered uses of lists like

	o	link1
	o	link2
		...

or

	1:	link1
	2:	link2
		...

So maybe this should just allow any long line with a uri/url

Quoted 19 lines
---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
scripts/checkpatch.pl +2 -0
index 7d16f863edf1..929574f43d4d 100755
@@ -3270,6 +3270,8 @@ sub process {
 					# filename then :
 		      $line =~ /^\s*(?:Fixes:|$link_tags_search|$signature_tags)/i ||
 					# A Fixes:, link or signature tag line
+		      $line =~ /^\s*\[\d+\]\s+[a-z][\w\.\+\-]*:\/\/\S+/i ||
+					# reference with URL
 		      $commit_log_possible_stack_dump)) {
 			WARN("COMMIT_LOG_LONG_LINE",
 			     "Prefer a maximum 75 chars per line (possible unwrapped commit description?)\n" . $herecurr);