summaryrefslogtreecommitdiff
path: root/utils/checkstyle.py
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-06-25 20:05:02 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-07-01 02:24:21 +0300
commit6f0c4d07420a94863a986123dffc61cf4c8235ba (patch)
tree09f8739b8df5db235974e329307ca68032e086c0 /utils/checkstyle.py
parentbc6b758c71a806039d2f5c4a34a72cc369228cc0 (diff)
utils: checkstyle.py: Add meson.build checker
Add a meson.build checker that warns when tabs are used. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'utils/checkstyle.py')
-rwxr-xr-xutils/checkstyle.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 5c8bde6e..bc631d40 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
#