[libcamera-devel] DNI: utils: checkstyle.py: Initialise trailers
diff mbox series

Message ID 20230710173146.4287-1-kieran.bingham@ideasonboard.com
State Not Applicable
Headers show
Series
  • [libcamera-devel] DNI: utils: checkstyle.py: Initialise trailers
Related show

Commit Message

Kieran Bingham July 10, 2023, 5:31 p.m. UTC
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@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(-)

Patch
diff mbox series

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: