From patchwork Mon Feb 2 11:25:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 26072 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E2F9AC3226 for ; Mon, 2 Feb 2026 11:25:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DCA0261FE8; Mon, 2 Feb 2026 12:25:30 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="AIZuLFgL"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 572B461FC8 for ; Mon, 2 Feb 2026 12:25:28 +0100 (CET) Received: from pb-laptop.local (185.221.142.123.nat.pool.zt.hu [185.221.142.123]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9730BC59 for ; Mon, 2 Feb 2026 12:24:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1770031487; bh=TsjCH/ReG1kEGibML7E8DOUtSMwuOHkZi+DImtqGfMo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AIZuLFgLP9Fx8hOE27evfmGa9pVtDUu+ZOrCPWL9W0txiJDUqkshkbb7k3NGcfbTp Zn5ewlZqN8RicRqU795Jjhi6TXlJQMiywwEydiNUvNEFExW3dhnBr/M3rNGrONX3O8 BSTDk8lHbpP9w5dqkK8JDcmQa8YgbTbARUXNO+Lg= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 2/3] utils: checkstyle.py: Make custom dependency checks possible Date: Mon, 2 Feb 2026 12:25:10 +0100 Message-ID: <20260202112511.640320-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260202112511.640320-1-barnabas.pocze@ideasonboard.com> References: <20260202112511.640320-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Previously it was only possible check the presence of a dependency, but no further checks, such as version checks, could be carried out. Make it possible for any checkers/formatters to specify a custom function for each dependency that is invoked to carry out extra cheks. Signed-off-by: Barnabás Pőcze --- utils/checkstyle.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/checkstyle.py b/utils/checkstyle.py index fa1355c17..06b9f199a 100755 --- a/utils/checkstyle.py +++ b/utils/checkstyle.py @@ -381,12 +381,22 @@ class CheckerBase(metaclass=ClassRegistry): issues = [] - for command in cls.dependencies: + for dep in cls.dependencies: + check = None + if type(dep) is str: + command = dep + else: + (command, check) = dep + if command not in dependencies: dependencies[command] = shutil.which(command) if not dependencies[command]: issues.append(CommitIssue(f'Missing {command} to run {cls.__name__}')) + elif check: + issues_ = check() + if issues_: + issues.extend(issues_) return issues