[libcamera-devel] [PATCH 1/4] utils: checkstyle.py: Treat Malformed trailers as a CommitIssue
Umang Jain
umang.jain at ideasonboard.com
Tue Jul 11 15:48:06 CEST 2023
Hi Kieran,
Thanks for the patch.
On 7/11/23 7:09 PM, Kieran Bingham via libcamera-devel wrote:
> If a Malformed trailer is identified the checkstyle script triggers a
> RuntimeError and stops processing the rest of the commit.
>
> A malformed trailer can be regarded as an issue in the commit and
> reported as such using the same method as other faults identified by the
> tool.
>
> Convert the RuntimeError into a CommitIssue and continue processing
> other trailers.
>
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
> utils/checkstyle.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/utils/checkstyle.py b/utils/checkstyle.py
> index 3558740d389d..5a1268064d31 100755
> --- a/utils/checkstyle.py
> +++ b/utils/checkstyle.py
> @@ -479,7 +479,8 @@ class TrailersChecker(CommitChecker):
> for trailer in commit.trailers:
> match = TrailersChecker.trailer_regex.fullmatch(trailer)
> if not match:
> - raise RuntimeError(f"Malformed commit trailer '{trailer}'")
> + issues.append(CommitIssue(f"Malformed commit trailer '{trailer}'"))
> + continue
>
> key, value = match.groups()
>
More information about the libcamera-devel
mailing list