@@ -575,6 +575,8 @@ class TrailersChecker(CommitChecker):
'Signed-off-by': email_regex,
'Suggested-by': email_regex,
'Tested-by': email_regex,
+ 'ABI': None,
+ 'API': None,
}
trailer_regex = re.compile(r'([A-Z][a-zA-Z-]*)\s*:\s*(.*)')
@@ -593,11 +595,14 @@ class TrailersChecker(CommitChecker):
key, value = match.groups()
- validator = TrailersChecker.known_trailers.get(key)
- if not validator:
+ if key not in TrailersChecker.known_trailers:
issues.append(CommitIssue(f"Invalid commit trailer key '{key}'"))
continue
+ validator = TrailersChecker.known_trailers[key]
+ if validator is None:
+ continue
+
if isinstance(validator, re.Pattern):
valid = bool(validator.fullmatch(value))
else:
The ABI and API trailers will allow contributors to document expected ABI and API breakage. The content may be extracted from the abi-compliance-checker tool and will not be specifically possible to validate precisely. The presences of an "ABI:" or "API:" key should be permitted by the tool. Extend the TrailersChecker to allow and support a trailer key which does not specify a validator, but where the Key itself is valid to exist in the Trailers section of a commit. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- utils/checkstyle.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)