From 6f0c4d07420a94863a986123dffc61cf4c8235ba Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 25 Jun 2019 20:05:02 +0300 Subject: utils: checkstyle.py: Add meson.build checker Add a meson.build checker that warns when tabs are used. Signed-off-by: Laurent Pinchart --- utils/checkstyle.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 # -- cgit v1.2.1