summaryrefslogtreecommitdiff
path: root/utils/checkstyle.py
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-08-04 14:50:35 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-08-05 19:37:29 +0300
commit8af95d6854889dc66746429ccf8888e3a81f6baf (patch)
tree446da71d679b2f102a53745dda474b3326e038e9 /utils/checkstyle.py
parent57396a0e3f08a5cd1ea6f48c66f3decdfeaa7dfd (diff)
utils: checkstyle.py: Warn when no valid Signed-off-by line is found
All commits to libcamera must include a Signed-off-by line, and that rule is enforced through git hooks and CI. This however doesn't prevent patches from being submitted without an SoB tag, as noticed multiple times in the past. Extend the checkstyle.py trailer checker to issue a warning when the SoB line is missing to try and improve the situation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'utils/checkstyle.py')
-rwxr-xr-xutils/checkstyle.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 4185c39a..7d480bdf 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -493,6 +493,8 @@ class TrailersChecker(CommitChecker):
def check(cls, commit, top_level):
issues = []
+ sob_found = False
+
for trailer in commit.trailers:
match = TrailersChecker.trailer_regex.fullmatch(trailer)
if not match:
@@ -515,6 +517,12 @@ class TrailersChecker(CommitChecker):
issues.append(CommitIssue(f"Malformed value '{value}' for commit trailer '{key}'"))
continue
+ if key == 'Signed-off-by':
+ sob_found = True
+
+ if not sob_found:
+ issues.append(CommitIssue(f"No valid 'Signed-off-by' trailer found, see Documentation/contributing.rst"))
+
return issues