From patchwork Tue Jun 25 17:09:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1520 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 784EC60103 for ; Tue, 25 Jun 2019 19:09:40 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2334C578 for ; Tue, 25 Jun 2019 19:09:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1561482580; bh=hwfx+z+6B9pAZabSL+5vTQQT/RIRaERL+vlReBMYCWY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lXwEWqCZMSg9hq6YTJFEGwzA9CTwcQQcxwO5UvtwnDIc4GNmIbAfXrhnm3Xf8EXK6 6HDUGcKQgI8caPfrnC9yq7EClKxvAkv2g8QKNi7amgBEDCDT1vILNSiu8myocraJf4 zRHLW6/ajko57PoTSSdzhw3XzlcA4oAjf/Rjh3vA= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 25 Jun 2019 20:09:17 +0300 Message-Id: <20190625170917.17818-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190625170917.17818-1-laurent.pinchart@ideasonboard.com> References: <20190625170917.17818-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] utils: checkstyle.py: Add meson.build checker X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 17:09:40 -0000 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 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 #