On 5/15/25 18:06, Cédric Le Goater wrote:
On 5/15/25 18:05, Daniel P. Berrangé wrote:
On Thu, May 15, 2025 at 02:59:36PM +0100, Daniel P. Berrangé wrote:
The previous commit mandates use of SPDX-License-Identifier on common
source files, and encourages it on all other files.
Some contributors are none the less still also including the license
boilerplate text. This is redundant and will potentially cause
trouble if inconsistent with the SPDX declaration.
Match common boilerplate text blurbs and report them as invalid,
for newly added files.
Signed-off-by: Daniel P. Berrangé <berra...@redhat.com>
---
scripts/checkpatch.pl | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 87050e6677..cb1942c021 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1496,6 +1496,13 @@ sub process_end_of_file {
"' need 'SPDX-License-Identifier'?");
}
}
+ if ($fileinfo->{action} eq "new" &&
+ !exists $fileinfo->{facts}->{sawboilerplate}) {
/face-palm - I forgot to remove the '!' here so the check is
inverted and my test patch had two very similarly named files
so didn't notice it :-(
Oh. I didn't see. No need to resend. I will fix in my tree.
It is now catching valid errors on :
*
https://lore.kernel.org/qemu-devel/20250512180230.50129-5-rre...@linux.ibm.com/
ERROR: New file 'hw/s390x/ap-stub.c' must not have license boilerplate header
text unless this file is copied from existing code with such text already
present.
total: 1 errors, 0 warnings, 67 lines checked
*
https://lore.kernel.org/qemu-devel/1747063973-124548-7-git-send-email-steven.sist...@oracle.com/
ERROR: New file 'hw/vfio/cpr-legacy.c' requires 'SPDX-License-Identifier'
ERROR: New file 'hw/vfio/cpr-legacy.c' must not have license boilerplate
header text unless this file is copied from existing code with such text
already present.
WARNING: added, moved or deleted file(s):
*
https://lore.kernel.org/qemu-devel/1747063973-124548-36-git-send-email-steven.sist...@oracle.com/
ERROR: New file 'hw/vfio/cpr-iommufd.c' requires 'SPDX-License-Identifier'
ERROR: New file 'hw/vfio/cpr-iommufd.c' must not have license boilerplate
header text unless this file is copied from existing code with such text
already present.
WARNING: added, moved or deleted file(s):
hw/vfio/cpr-iommufd.c
Does MAINTAINERS need updating?
total: 2 errors, 1 warnings, 161 lines checked
*
https://lore.kernel.org/qemu-devel/20250515154413.210315-1-john.le...@nutanix.com
ERROR: New file 'hw/vfio-user/container.h' must not have license boilerplate
header text unless this file is copied from existing code with such text
already present.
ERROR: New file 'hw/vfio-user/container.c' must not have license boilerplate
header text unless this file is copied from existing code with such text
already present.
ERROR: New file 'hw/vfio-user/pci.c' must not have license boilerplate header
text unless this file is copied from existing code with such text already
present.
WARNING: Does new file 'hw/vfio-user/meson.build' need
'SPDX-License-Identifier'?
total: 3 errors, 1 warnings, 490 lines checked
and more.
Tested-by: Cédric Le Goater <c...@redhat.com>
Reviewed-by: Cédric Le Goater <c...@redhat.com>
Thanks,
C.