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>
This commit is contained in:
parent
bc6b758c71
commit
6f0c4d0742
1 changed files with 16 additions and 0 deletions
|
@ -260,6 +260,22 @@ class LogCategoryChecker(StyleChecker):
|
||||||
return issues
|
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
|
# Formatters
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue