[v2,2/3] utils: checkstyle.py: Validate SoB trailer against author
diff mbox series

Message ID 20240807121516.13608-3-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • utils: checkstyle.py: Improve trailer validation
Related show

Commit Message

Laurent Pinchart Aug. 7, 2024, 12:15 p.m. UTC
The TrailersChecker enforces the presence of a Signed-off-by tag in the
trailer, but doesn't verify that the tag matches the commit's author.
Add that verification, as required by the libcamera contribution
process.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 utils/checkstyle.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index e8451846c0c2..560a2c1e8c58 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -525,10 +525,11 @@  class TrailersChecker(CommitChecker):
                 continue
 
             if key == 'Signed-off-by':
-                sob_found = True
+                if value == commit.author:
+                    sob_found = True
 
         if not sob_found:
-            issues.append(CommitIssue(f"No valid 'Signed-off-by' trailer found, see Documentation/contributing.rst"))
+            issues.append(CommitIssue(f"No 'Signed-off-by' trailer matching author '{commit.author}', see Documentation/contributing.rst"))
 
         return issues