This is hugely expanded an update of https://lists.nongnu.org/archive/html/qemu-devel/2025-05/msg02040.html
In that series, Peter suggested creating standalone methods to act as hooks to call when detecting the start/end of a file in a diff. This implements that idea and adapts a number of existing checks to use the new hooks. Changed in v5: - Actually make boilerplate text regex work, the '/x' operator culls *all* whitespace from the regex, which was not desirable as we need space between words. - Fix inverted check of boilerplate result Changed in v4: - Pull our boilerplate match regex to separate variable - Mention that SPDX is sufficient when reporting redundant boilerplate - Tweak commit message to explain indent changes better Changed in v3: - Add check for redundent license boilerplate text - Fix check for Makefile names Daniel P. Berrangé (9): Revert "scripts: mandate that new files have SPDX-License-Identifier" scripts/checkpatch.pl: fix various indentation mistakes scripts/checkpatch: introduce tracking of file start/end scripts/checkpatch: use new hook for ACPI test data check scripts/checkpatch: use new hook for file permissions check scripts/checkpatch: expand pattern for matching makefiles scripts/checkpatch: use new hook for MAINTAINERS update check scripts/checkpatch: reimplement mandate for SPDX-License-Identifier scripts/checkpatch: reject license boilerplate on new files scripts/checkpatch.pl | 389 +++++++++++++++++++++++++++--------------- 1 file changed, 251 insertions(+), 138 deletions(-) -- 2.49.0