]> git.ipfire.org Git - thirdparty/qemu.git/commit
scripts/checkpatch: introduce tracking of file start/end
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 12 May 2025 15:57:38 +0000 (16:57 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 22 May 2025 10:24:41 +0000 (11:24 +0100)
commit25374ba59bce2d8c714283c7bb18b1dc2cc89ebe
treecb9343116c5db5200fb52c6f9c21aa3653cce22f
parent619bf37594e362131f12b42888e6a35ddee488e0
scripts/checkpatch: introduce tracking of file start/end

Some checks want to be performed either at the start of a new file
within a patch, or at the end. This is complicated by the fact that
the information relevant to the check may be spread across multiple
lines. It is further complicated by a need to support both git and
non-git diffs, and special handling for renames where there might
not be any patch hunks.

To handle this more sanely, introduce explicit tracking of file
start/end, taking account of git metadata, and calling a hook
function at each transition.

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
scripts/checkpatch.pl