[libcamera-devel] [PATCH] DNI: utils: checkstyle.py: Initialise trailers

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Jul 10 19:31:46 CEST 2023


The commit trailers are checked as part of processing the commit message
with the newly introduced TrailersChecker.

This relies on the trailers property being correctly exposed by the
Commit object, and is implemented for the base Commit.

Ensure it's initialised for all Commits.

This is a temporary solution, as it doesn't solve for Amended commits.

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---

Hi Naush,

This will solve your issue in the short term - but I'm trying to make a
proper fix that will also still do the trailer checks for Amended
commits, but not Staged commits.

 utils/checkstyle.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 8242314c1bb5..18a68d2cf33c 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -206,6 +206,7 @@ class CommitFile:
 class Commit:
     def __init__(self, commit):
         self.commit = commit
+        self._trailers = []
         self._parse()
 
     def _parse(self):
@@ -217,7 +218,6 @@ class Commit:
 
         self._title = lines[0]
 
-        self._trailers = []
         for index in range(1, len(lines)):
             line = lines[index]
             if not line:
-- 
2.34.1



More information about the libcamera-devel mailing list