[libcamera-devel] [PATCH 2/2] utils: checkstyle.py: Add meson.build checker
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Tue Jun 25 19:09:17 CEST 2019
Add a meson.build checker that warns when tabs are used.
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
utils/checkstyle.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 5c8bde6e1f46..bc631d405007 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -260,6 +260,22 @@ class LogCategoryChecker(StyleChecker):
return issues
+class MesonChecker(StyleChecker):
+ patterns = ('meson.build',)
+
+ def __init__(self, content):
+ super().__init__()
+ self.__content = content
+
+ def check(self, line_numbers):
+ issues = []
+ for line_number in line_numbers:
+ line = self.__content[line_number-1]
+ if line.find('\t') != -1:
+ issues.append(StyleIssue(line_number, line, 'meson.build should use spaces for indentation'))
+ return issues
+
+
# ------------------------------------------------------------------------------
# Formatters
#
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list