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>
This commit is contained in:
+2
-1
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user