summaryrefslogtreecommitdiff
path: root/utils/checkstyle.py
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2023-07-11 14:26:37 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-07-18 09:25:13 +0100
commitb14d2cab127b05399348cca31eb9190eee0f305f (patch)
tree1080114cf7fd1a9555b63a93f63c9c97c6dd2e94 /utils/checkstyle.py
parent668a5e674aed65b8982b449b4bed58ff7e3e1413 (diff)
utils: checkstyle.py: Treat Malformed trailers as a CommitIssue
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. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'utils/checkstyle.py')
-rwxr-xr-xutils/checkstyle.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 3558740d..5a126806 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()