qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Ignore removed lines in license check
@ 2025-09-16 16:59 Nabih Estefan
  2025-09-17  9:00 ` Alex Bennée
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Nabih Estefan @ 2025-09-16 16:59 UTC (permalink / raw)
  To: qemu-devel, --save; +Cc: peter.maydell, berrange, Nabih Estefan

When running the license check, if we are updating a license it is
possible for the checkpatch script to test against old license lines
instead of newer ones, since the removal lines appear before the
addition lines in a .patch file.

Fix this by skipping over lines that start with "-" in the checkpatch
script.

Signed-off-by: Nabih Estefan <nabihestefan@google.com>
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 833f20f555..c57a423f9f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1813,7 +1813,8 @@ sub process {
 		}
 
 # Check SPDX-License-Identifier references a permitted license
-		if ($rawline =~ m,SPDX-License-Identifier: (.*?)(\*/)?\s*$,) {
+		if (($rawline =~ m,SPDX-License-Identifier: (.*?)(\*/)?\s*$,) &&
+			$rawline !~ /^-/) {
 			$fileinfo->{facts}->{sawspdx} = 1;
 			&checkspdx($realfile, $1);
 		}
-- 
2.51.0.384.g4c02a37b29-goog



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-09-17 16:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 16:59 [PATCH] checkpatch: Ignore removed lines in license check Nabih Estefan
2025-09-17  9:00 ` Alex Bennée
2025-09-17  9:24 ` Daniel P. Berrangé
2025-09-17 15:16   ` Nabih Estefan
2025-09-17 16:05     ` Daniel P. Berrangé
2025-09-17 16:17       ` Nabih Estefan
2025-09-17 16:24         ` Daniel P. Berrangé
2025-09-17 16:43 ` Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).