[PATCH 2/3] utils: checkstye: Show issue position for python issues

Stefan Klug stefan.klug at ideasonboard.com
Fri Aug 30 14:52:59 CEST 2024


pycodestyle doesn't report the issue length. But it reports the
position. Use that as indicator with zero length. This is better than no
indicator at all and reduces confusion when multiple issues occur on the
same line.

Signed-off-by: Stefan Klug <stefan.klug at ideasonboard.com>
---
 utils/checkstyle.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index c6016f60a446..5901f1a71562 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -737,7 +737,7 @@ class Pep8Checker(StyleChecker):
 
             if line_number in line_numbers:
                 line = self.__content[line_number - 1]
-                issues.append(StyleIssue(line_number, None, line, msg))
+                issues.append(StyleIssue(line_number, [position, position + 1], line, msg))
 
         return issues
 
-- 
2.43.0



More information about the libcamera-devel mailing list