[libcamera-devel] [PATCH 1/4] utils: checkstyle.py: Treat Malformed trailers as a CommitIssue
Kieran Bingham
kieran.bingham at ideasonboard.com
Tue Jul 11 15:39:12 CEST 2023
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>
---
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()
--
2.34.1
More information about the libcamera-devel
mailing list