From patchwork Mon Feb 2 11:25:09 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: 26071 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 CF314C3226 for ; Mon, 2 Feb 2026 11:25:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E0AFA61FFC; Mon, 2 Feb 2026 12:25:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="MJax8T7m"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 16DC361F61 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 67FFE874 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=t9oJzcoQz1RyqWxUCjT5NlTVd/fWxQBYA66hUvkVuXo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MJax8T7mrYVE9J+ZA6ehNk0vuGlICrgOW1fZEmytNSd4S9xXt+inavuwD82K49Fjv NtQ3ONlPzy3noNtJK1SkgONvFssjtzcci4aj3RTEvrBatgky9DBj3lWMCsxT29q64R bEW94YORMEUga0wpSuV+DLKkMYYa8st6u2bkei4Q= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 1/3] meson: Add `meson.format` file Date: Mon, 2 Feb 2026 12:25:09 +0100 Message-ID: <20260202112511.640320-2-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" Since meson 1.5.0, `meson format` subcommand is available for formatting meson.build files[0]. This formatter uses the `meson.format` file to store options. So add one, mostly instructing it to follow the existing .editorconfig settings. [0]: https://mesonbuild.com/Commands.html#format Signed-off-by: Barnabás Pőcze --- I tried to match the current formatting, but only changed those options that have different defaults. There does not seem to be an option that matches the current formatting of long lines. So I'm afraid those need to change if `meson format` is to be used. I quite like `kwargs_force_multiline=true` personally, so wouldn't mind too much. --- meson.format | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 meson.format -- 2.52.0 diff --git a/meson.format b/meson.format new file mode 100644 index 000000000..c50ca9b0a --- /dev/null +++ b/meson.format @@ -0,0 +1,2 @@ +use_editor_config = true +wide_colon = true 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 From patchwork Mon Feb 2 11:25:11 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: 26073 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 F28E1C328F for ; Mon, 2 Feb 2026 11:25:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7793361FF5; Mon, 2 Feb 2026 12:25:31 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HuUSu8A7"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8681061FE2 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 C39B01AAE 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=PETqY9QSHav8oRqZUgoSWAzbKDOOp7zkBjJIBZKsHUU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HuUSu8A7ygx48IoFGH9ND9cO2neQOQbrqagIsFa4mhknRj5RZllkPZAkHgc8awq4H 3QN72EVDqXQEehnFH6toXhZxE1FsGEEWI1/+hszeEqg10jOTSr+dmGjcEzZC/ryEws 8hkmrTWTGdd8hgzx1RfEi6cj4xqL6nKqAsPUH7B8= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 3/3] utils: checkstyle.py: Add `MesonFormatter` Date: Mon, 2 Feb 2026 12:25:11 +0100 Message-ID: <20260202112511.640320-4-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" Add support for diagnosing meson file style issues using `meson format`. Signed-off-by: Barnabás Pőcze --- This probably makes `MesonChecker` unnecessary. --- utils/checkstyle.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) -- 2.52.0 diff --git a/utils/checkstyle.py b/utils/checkstyle.py index 06b9f199a..2dfff0473 100755 --- a/utils/checkstyle.py +++ b/utils/checkstyle.py @@ -919,6 +919,36 @@ class StripTrailingSpaceFormatter(Formatter): lines[i] = lines[i].rstrip() + '\n' return ''.join(lines) +class MesonFormatter(Formatter): + @staticmethod + def _check_meson_version(): + # 1.5.0 for `meson format` + # 1.7.0 for stdin input + # 1.9.0 for `--source-file-path` + VERSION_REQ = (1, 9, 0) + + ret = subprocess.run(['meson', '--version'], + stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + + ver = tuple(map(int, ret.stdout.decode('utf-8').split('.'))) + if ver < VERSION_REQ: + return [ + CommitIssue(f'Missing meson {".".join(map(str, VERSION_REQ))} to run `meson format`') + ] + + + dependencies = (('meson', _check_meson_version), ) + patterns = ('meson.build', ) + + @classmethod + def format(cls, filename, data): + ret = subprocess.run(['meson', 'format', '-', + '--source-file-path', filename], + input=data.encode('utf-8'), stdout=subprocess.PIPE) + return ret.stdout.decode('utf-8') + # ------------------------------------------------------------------------------ # Style checking