[libcamera-devel,v1,1/4] utils: checkstyle: Add __repr__ method to CommitFile class
diff mbox series

Message ID 20230612224751.4437-2-laurent.pinchart@ideasonboard.com
State Accepted
Commit c9b2f62eddf9ecf6f3e4557050b08bd0c560c693
Headers show
Series
  • utils: checkstyle: Add a commit message trailers checker
Related show

Commit Message

Laurent Pinchart June 12, 2023, 10:47 p.m. UTC
Add a custom representation to the CommitFile class in order to
facilitate debugging.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 utils/checkstyle.py | 3 +++
 1 file changed, 3 insertions(+)

Comments

Kieran Bingham July 5, 2023, midnight UTC | #1
Quoting Laurent Pinchart via libcamera-devel (2023-06-12 23:47:48)
> Add a custom representation to the CommitFile class in order to
> facilitate debugging.
> 

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  utils/checkstyle.py | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/utils/checkstyle.py b/utils/checkstyle.py
> index 5cc523b6fba3..7da888d8c365 100755
> --- a/utils/checkstyle.py
> +++ b/utils/checkstyle.py
> @@ -191,6 +191,9 @@ class CommitFile:
>          else:
>              self.__filename = info[1]
>  
> +    def __repr__(self):
> +        return f'{self.__status} {self.__filename}'
> +
>      @property
>      def filename(self):
>          return self.__filename
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 5cc523b6fba3..7da888d8c365 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -191,6 +191,9 @@  class CommitFile:
         else:
             self.__filename = info[1]
 
+    def __repr__(self):
+        return f'{self.__status} {self.__filename}'
+
     @property
     def filename(self):
         return self.__filename