lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250113-footnote-links-v1-1-3e9b6196d478@pengutronix.de>
Date: Mon, 13 Jan 2025 23:21:58 +0100
From: Ahmad Fatoum <a.fatoum@...gutronix.de>
To: Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>, 
 Dwaipayan Ray <dwaipayanray1@...il.com>, 
 Lukas Bulwahn <lukas.bulwahn@...il.com>
Cc: linux-kernel@...r.kernel.org, kernel@...gutronix.de, 
 Ahmad Fatoum <a.fatoum@...gutronix.de>
Subject: [PATCH] checkpatch: don't warn about long lines with footnote
 links

checkpatch will warn[0] about lines like the first footnote below,
but breaking into multiple lines is not an option if the footnote
is just a URL.

While there's already an exception for Link: tags and some commit
messages add a footnote after it[1], the result is more noisy and harder
to follow when mixed with non-URL footnotes, so explicit support for
footnotes-prefixed URLs makes sense.

[0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl#n3289
[1]: Commit 6612ac8c625c ("lib/list_sort: clarify comparison function
     requirements in list_sort()")

Signed-off-by: Ahmad Fatoum <a.fatoum@...gutronix.de>
---
 scripts/checkpatch.pl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7b28ad3317427a6bf9e27b77065aa3915cb13053..febc05c381856361120c02b9b52694cc6fa95302 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -642,6 +642,8 @@ foreach my $entry (@link_tags) {
 }
 $link_tags_search = "(?:${link_tags_search})";
 
+our $link_footnote = "(?:\\[\\d\\]: https?://)";
+
 our $tracing_logging_tags = qr{(?xi:
 	[=-]*> |
 	<[=-]* |
@@ -3272,8 +3274,8 @@ sub process {
 					# file delta changes
 		      $line =~ /^\s*(?:[\w\.\-\+]*\/)++[\w\.\-\+]+:/ ||
 					# filename then :
-		      $line =~ /^\s*(?:Fixes:|$link_tags_search|$signature_tags)/i ||
-					# A Fixes:, link or signature tag line
+		      $line =~ /^\s*(?:Fixes:|$link_tags_search|$signature_tags|$link_footnote)/i ||
+					# A Fixes:, link, footnote or signature tag line
 		      $commit_log_possible_stack_dump)) {
 			WARN("COMMIT_LOG_LONG_LINE",
 			     "Prefer a maximum 75 chars per line (possible unwrapped commit description?)\n" . $herecurr);

---
base-commit: 37136bf5c3a6f6b686d74f41837a6406bec6b7bc
change-id: 20250113-footnote-links-acbd4d0e5439

Best regards,
-- 
Ahmad Fatoum <a.fatoum@...gutronix.de>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ