From patchwork Sat Jan 3 20:32:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1248 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472381; bh=OCkNpXKpwKI95HRx18Pe3VNpouhoWHZSfEavj407dF0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ERyMrup9BnIDHDtcUOSmrnCqLBb4ZZqUQT1Ih466LHiodX1tEegkoDrNafnJJAPxt tAMlown0oRuAmtFnS/7zMYPUlshLkaOoCZjTJLxXthM1+R+36u+GwmBoiI/SHgswWD 7KiosxWU0fFAPIzL3XJDPhLmq1eJuM3xD5Gb85uMSujyhtC5yB4cAQkrGnndZFcx5d 7vKRvoiy2rFZBAXJO3jbnTe174YTh3VwlQfxfuBUXQvS3uczReQ4Q72/ncnl1oadMg xHXhWxA1wOnyidZuwiMazN36/Wom0NKEDkF2pO6HWWq1irt9cGl7Hen+QQlifg4Q2O PNYwGhdAIWvfQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6B50F68F71 for ; Sat, 3 Jan 2026 13:33:01 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id GufYijpJdNhc for ; Sat, 3 Jan 2026 13:33:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472381; bh=OCkNpXKpwKI95HRx18Pe3VNpouhoWHZSfEavj407dF0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ERyMrup9BnIDHDtcUOSmrnCqLBb4ZZqUQT1Ih466LHiodX1tEegkoDrNafnJJAPxt tAMlown0oRuAmtFnS/7zMYPUlshLkaOoCZjTJLxXthM1+R+36u+GwmBoiI/SHgswWD 7KiosxWU0fFAPIzL3XJDPhLmq1eJuM3xD5Gb85uMSujyhtC5yB4cAQkrGnndZFcx5d 7vKRvoiy2rFZBAXJO3jbnTe174YTh3VwlQfxfuBUXQvS3uczReQ4Q72/ncnl1oadMg xHXhWxA1wOnyidZuwiMazN36/Wom0NKEDkF2pO6HWWq1irt9cGl7Hen+QQlifg4Q2O PNYwGhdAIWvfQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 57206690BA for ; Sat, 3 Jan 2026 13:33:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472379; bh=wpZxqEoCeff0EjQAl39tJUZ0u7v0AOtrINW/D+zjM0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iOQ3eAuineeuuQDwAPpGgicS5tLBgUETbm/du8Jv35KVKwOJDH4xejwGjPH3m4AyN h6aT+EFLrXNwPligMCsmLp8nraKcCdmafJm3reqqaKc21A3Lyzo5zECXsCFbvpRIQ1 4OO0D1YTaPNrnbXNmWHAMp/GoKMwSL1NVzasF/tGM/0WJovzsaKk1ZzXWOoreijzwm hEffv7XvzqW9+pqXfO8audmm8anR2U8vzOAJ0ZNyVxeEWa9wj4dJdlSXoqbXCl2u9M xt3GemgOHUaZeoo8NHw6G+tkaZ93Lg5aF8GbFFIrmIIsH7LE9H3oxipN11UmqN4lvU mV3vlaYb0GmzA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D69DD68F71; Sat, 3 Jan 2026 13:32:59 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id SdUSq9HkigLS; Sat, 3 Jan 2026 13:32:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472375; bh=Xejol2a4bcKQb+x7FK3FWmw9oBALr33/0vNGVBBC6s8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uKOmRB7Q9WSsMo/PkMx2Xe2kkOBaDmlNOrRur6g9RAnTRt62lZsUXuBxu4stvbi/d PJs95aqE5Y9cPBjGnKh2CSrnrs0b7D7cRTBVzPIuOtxRWB9hFN2jygUJRBaEZhugzW ssowtr0xJ2VjBRqkSyWoUEZmjI8z4n6aoTlGOiEQHO7YYBzTGW1vkPY5qa/H2OPUKP dfPBn+NOSFAAT9hnBAuUQi5DTsf7hf60cL1JawHwHgOoIhFie477hx9W7ZsCTshcHU REFYICLtYWkClmyU95W4zhIEkHTBhEZJet7cUIwUdlWfyc4Ldi+bU5XYVZVUWeCch/ T5JmV1pWrYdbQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 699E1690BA; Sat, 3 Jan 2026 13:32:55 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:27 -0700 Message-ID: <20260103203243.3727493-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: V2IRHODG4QOECQYSXODHEWRM2UDNZ5B3 X-Message-ID-Hash: V2IRHODG4QOECQYSXODHEWRM2UDNZ5B3 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/12] buildman: Suppress pylint warnings in board.py List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The Board class is a data container that legitimately needs many attributes and constructor arguments. Suppress the following warnings: - too-many-instance-attributes - too-few-public-methods - too-many-arguments Also add missing type annotations to the docstring for consistency. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/board.py | 18 ++++++++++-------- tools/buildman/boards.py | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/buildman/board.py b/tools/buildman/board.py index c061bf56039..1d1de1123db 100644 --- a/tools/buildman/board.py +++ b/tools/buildman/board.py @@ -4,21 +4,23 @@ """A single board which can be selected and built""" +# pylint: disable=too-many-instance-attributes,too-few-public-methods class Board: """A particular board that we can build""" + # pylint: disable=too-many-arguments def __init__(self, status, arch, cpu, soc, vendor, board_name, target, cfg_name, extended=None, orig_target=None): """Create a new board type. Args: - status: define whether the board is 'Active' or 'Orphaned' - arch: Architecture name (e.g. arm) - cpu: Cpu name (e.g. arm1136) - soc: Name of SOC, or '' if none (e.g. mx31) - vendor: Name of vendor (e.g. armltd) - board_name: Name of board (e.g. integrator) - target: Target name (use make _defconfig to configure) - cfg_name: Config-file name (in includes/configs/) + status (str): Either 'Active' or 'Orphaned' + arch (str): Architecture name (e.g. arm) + cpu (str): Cpu name (e.g. arm1136) + soc (str): Name of SOC, or '' if none (e.g. mx31) + vendor (str): Name of vendor (e.g. armltd) + board_name (str): Name of board (e.g. integrator) + target (str): Target name (use make _defconfig to configure) + cfg_name (str): Config-file name (in includes/configs/) extended (boards.Extended): Extended board, if this board is one orig_target (str): Name of target this extended board is based on """ diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 2330315fe95..793055550fb 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -790,6 +790,7 @@ class Boards: """Add Status and Maintainers information to the board parameters list. Args: + srcdir (str): Directory containing source code (MAINTAINERS files) params_list (list of dict): A list of the board parameters Returns: From patchwork Sat Jan 3 20:32:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1249 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472386; bh=j4/FrPFbxxwxhArDBkE8Ax4grPTCm2tfEYoEFnxR9TM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gSTqVsyMihpdndMsvVcIRQobKqcB0Qrg695oOjrz1Acgdv/4ahkPRNmCaQYZXEixS MQUv2XSVmC08vp9cGih1mtIz3SYlrkGv5tW3vnveplPZ3Xei/BT/0B/cVy9Wwh1Dzq JnnS6mf6fnQQcP4ndPTsy6D+CEp70TSYi++EIkIA5OuteJsB1DSd3eW4ZSOa6LddAB 5uR6NQ7xeZtSIvWpxOn1SphoiyJ36Ly4m1uaNtQU37gvy2v6x0MzOtRgVwLbuPRlmL +xoDxRIWykSLGFwKiTAe0l2qfoC+bDnNqHMk5Q0uwsYXhmSUoUSB5GOFqKfbVe13rr rMpP2GZOXTTuA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A12AC68F71 for ; Sat, 3 Jan 2026 13:33:06 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gCkUDnksQxtY for ; Sat, 3 Jan 2026 13:33:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472386; bh=j4/FrPFbxxwxhArDBkE8Ax4grPTCm2tfEYoEFnxR9TM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gSTqVsyMihpdndMsvVcIRQobKqcB0Qrg695oOjrz1Acgdv/4ahkPRNmCaQYZXEixS MQUv2XSVmC08vp9cGih1mtIz3SYlrkGv5tW3vnveplPZ3Xei/BT/0B/cVy9Wwh1Dzq JnnS6mf6fnQQcP4ndPTsy6D+CEp70TSYi++EIkIA5OuteJsB1DSd3eW4ZSOa6LddAB 5uR6NQ7xeZtSIvWpxOn1SphoiyJ36Ly4m1uaNtQU37gvy2v6x0MzOtRgVwLbuPRlmL +xoDxRIWykSLGFwKiTAe0l2qfoC+bDnNqHMk5Q0uwsYXhmSUoUSB5GOFqKfbVe13rr rMpP2GZOXTTuA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 86D34690BC for ; Sat, 3 Jan 2026 13:33:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472384; bh=2IfbPUPWPyPm0CmkQ9Hd+MVFdVuNX1fskVnA0EEezJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=URPPfI1oVxVibrf7sK19MGfV8W5MB3awFMfDRYpTYM/NgJS5ZAmVmKT9xSQRBuWeB DkLf0u980WJhcCa77VEwsPGT+pv/49mWiSwBm9+N+b7L/6pBO+YJ7S6ROoRVns7P/+ BQegJhQEpj2NUfwk6yEH7excui0CUxNOhMDVCH29JWrpzbjFb0DmD8hnN+AqWo+dCp eXKHEjq57DCdsYiNuaPZ+JrsYYfEi20ucN0rJLtXqbv/qVVrS0AieSxtd6QbcFwhVy i1EXpZvtaeP7JKorK8dQNBVCOh/QFn7tJpM4Ls+BN6dHfikUapdcEU3uNr3j+RDFZ1 hm2rzvzVYwLWA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A577E68F71; Sat, 3 Jan 2026 13:33:04 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id O0XEXF7tFQK9; Sat, 3 Jan 2026 13:33:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472380; bh=Pfm11IpogP2kF7x5cPqJiz+7w9c6d3T+eukYS0yiaPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Es0hLavlSg528rbSOc0lpB+D+62VfdMBVVjQoYzaZsZDEzgdarbUN7FexA+/RuAQW TjuVSObwkbfCLy1wzxhe+rNnxUu+QoAhDurZwiWB/HaBfyNbR88m0NhGb1OXFgD2vp j5NI/cEsaz/WJ1t9WOEyTvit1guPFJRuX4Ijp+lkGu5ouR9dIuMUevLueAHU+ZS1sE dA7AV5djtKLJqU/6tK1ux3b/Y/jzZWQDKLqv3zJFcdSIsMLsw4VTaeoD7mG8XogdiG ADV75iHjvP5/xrDjDwrjFcIgzciwkhWC7VEhiDJslf1/avoS9oGJ1+La4BNHToHXBg 7cFfMaJRXkLBQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 250AA68FC8; Sat, 3 Jan 2026 13:33:00 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:28 -0700 Message-ID: <20260103203243.3727493-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: K3TNLUEVKF5FLTV5VYTK674DFX37IHR7 X-Message-ID-Hash: K3TNLUEVKF5FLTV5VYTK674DFX37IHR7 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/12] buildman: Fix pylint warnings in boards.py List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Fix line-too-long warnings by wrapping long lines, and add missing return-type documentation to various functions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 81 +++++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 793055550fb..f503d8ef208 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -69,8 +69,8 @@ def output_is_new(output, config_dir, srcdir): srcdir (str): Directory containing Kconfig and MAINTAINERS files Returns: - True if the given output file exists and is newer than any of - *_defconfig, MAINTAINERS and Kconfig*. False otherwise. + bool: True if the given output file exists and is newer than any of + *_defconfig, MAINTAINERS and Kconfig*. False otherwise. Raises: OSError: output file exists but could not be opened @@ -134,8 +134,9 @@ class Expr: Args: props (list of str): List of properties to check + Returns: - True if any of the properties match the regular expression + bool: True if any of the properties match the regular expression """ for prop in props: if self._re.match(prop): @@ -175,8 +176,9 @@ class Term: Args: props (list of str): List of properties to check + Returns: - True if all of the expressions in the Term match, else False + bool: True if all of the expressions in the Term match, else False """ for expr in self._expr_list: if not expr.matches(props): @@ -287,13 +289,15 @@ class KconfigScanner: tname = name[7:].lower() if target: warnings.append( - f'WARNING: {leaf}: Duplicate TARGET_xxx: {target} and {tname}') + f'WARNING: {leaf}: Duplicate TARGET_xxx: ' + f'{target} and {tname}') else: target = tname if not target: cfg_name = expect_target.replace('-', '_').upper() - warnings.append(f'WARNING: {leaf}: No TARGET_{cfg_name} enabled') + warnings.append( + f'WARNING: {leaf}: No TARGET_{cfg_name} enabled') params['target'] = expect_target @@ -502,7 +506,7 @@ class Boards: """Return a list of available boards. Returns: - List of Board objects + list of Board: List of Board objects """ return self._boards @@ -523,7 +527,8 @@ class Boards: """Return a dictionary containing the selected boards Returns: - List of Board objects that are marked selected + OrderedDict: Boards that are marked selected (key=target, + value=Board) """ board_dict = OrderedDict() for brd in self._boards: @@ -535,7 +540,7 @@ class Boards: """Return a list of selected boards Returns: - List of Board objects that are marked selected + list of Board: Board objects that are marked selected """ return [brd for brd in self._boards if brd.build_it] @@ -543,7 +548,7 @@ class Boards: """Return a list of selected boards Returns: - List of board names that are marked selected + list of str: Board names that are marked selected """ return [brd.target for brd in self._boards if brd.build_it] @@ -616,10 +621,10 @@ class Boards: brds (list of Board): List of boards to build, or None/[] for all Returns: - Tuple - Dictionary which holds the list of boards which were selected - due to each argument, arranged by argument. - List of errors found + tuple: + OrderedDict: Boards selected due to each argument, keyed by + argument + list of str: Errors/warnings found """ def _check_board(brd): """Check whether to include or exclude a board @@ -768,8 +773,8 @@ class Boards: params_list = [] warnings = set() - # Data in the queues should be retrieved preriodically. - # Otherwise, the queues would become full and subprocesses would get stuck. + # Data in the queues should be retrieved preriodically. Otherwise, + # the queues would become full and subprocesses would get stuck. while any(p.is_alive() for p in processes): self.read_queues(queues, params_list, warnings) # sleep for a while until the queues are filled @@ -885,7 +890,8 @@ class Boards: output (str): The name of the output file jobs (int): The number of jobs to run simultaneously force (bool): Force to generate the output even if it is new - quiet (bool): True to avoid printing a message if nothing needs doing + quiet (bool): True to avoid printing a message if nothing needs + doing Returns: bool: True if all is well, False if there were warnings @@ -964,7 +970,15 @@ class Boards: self.add_board(newb) def scan_extended(self, dbase, ext): - """Scan for extended boards""" + """Scan for extended boards + + Args: + dbase (tuple): Database of defconfigs + ext (Extended): Extended-board definition + + Returns: + set of str: Set of board names matching the extended definition + """ # First check the fragments frags = [] for frag in ext.fragments: @@ -1026,13 +1040,28 @@ class ExtendedParser: @staticmethod def parse_file(fname): - """Parse a file and return the result""" + """Parse a file and return the result + + Args: + fname (str): Filename to parse + + Returns: + list of Extended: List of extended-board definitions + """ return ExtendedParser.parse_data(fname, tools.read_file(fname, binary=False)) @staticmethod def parse_data(fname, data): - """Parse a file and return the result""" + """Parse a file and return the result + + Args: + fname (str): Filename (for error messages) + data (str): Contents of the file + + Returns: + list of Extended: List of extended-board definitions + """ parser = ExtendedParser() parser.parse(fname, data) return parser.extended @@ -1043,6 +1072,12 @@ class ExtendedParser: Args: fname (str): Filename to parse (used for error messages) data (str): Contents of the file + + Returns: + list of Extended: List of extended-board definitions + + Raises: + ValueError: Invalid syntax in file """ self.start() for seq, line in enumerate(data.splitlines()): @@ -1055,7 +1090,8 @@ class ExtendedParser: if '=' in line: pair = line.split('=') if len(pair) != 2: - raise ValueError(f'{fname}:{linenum}: Invalid CONFIG syntax') + raise ValueError( + f'{fname}:{linenum}: Invalid CONFIG syntax') first, rest = pair cfg = first.strip() value = rest.strip() @@ -1063,7 +1099,8 @@ class ExtendedParser: else: target = line.strip() if ' ' in target: - raise ValueError(f'{fname}:{linenum}: Invalid target regex') + raise ValueError( + f'{fname}:{linenum}: Invalid target regex') self.targets.append(['regex', line.strip()]) else: pair = line.split(':') From patchwork Sat Jan 3 20:32:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1250 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472390; bh=G+MH5ATQLxN4MZn3nRVAO5/qjkvhYdz7ebMuLVJjjs0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=V5O0rhYFDyYoGqHph86zPQZ/4Yo6VZ1M9KoxMNb5ga7JnTcSvaEhHuQ4kCAAJ5swD 21rw23VeIbOx8HXZrQpisL3oCFTHrI0Y5z++kQu98bnUVwtHJe7ATGY1rYCB1A//hL pOKnAQiezznZUkFXNunKHiCU/eMuSwuKeS+63poR19mEk5malkg/DSN0hed918Ra8f 4C2CdsAo9z1+7H6fCc0IEWQnGqB2tEoFJcrkQqnY4wN7T1lsgbyRV0XCzwqYedoDIa Q/s0JO9Ipz2SROYiuF9uBDraSkDYVs0r+Qx/+nZ4r+N+lDq0NmIcCEsnzKdk7DNKtS PzNJ4K25Te/Lg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 727C668F71 for ; Sat, 3 Jan 2026 13:33:10 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id If8VJqIgP7AR for ; Sat, 3 Jan 2026 13:33:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472390; bh=G+MH5ATQLxN4MZn3nRVAO5/qjkvhYdz7ebMuLVJjjs0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=V5O0rhYFDyYoGqHph86zPQZ/4Yo6VZ1M9KoxMNb5ga7JnTcSvaEhHuQ4kCAAJ5swD 21rw23VeIbOx8HXZrQpisL3oCFTHrI0Y5z++kQu98bnUVwtHJe7ATGY1rYCB1A//hL pOKnAQiezznZUkFXNunKHiCU/eMuSwuKeS+63poR19mEk5malkg/DSN0hed918Ra8f 4C2CdsAo9z1+7H6fCc0IEWQnGqB2tEoFJcrkQqnY4wN7T1lsgbyRV0XCzwqYedoDIa Q/s0JO9Ipz2SROYiuF9uBDraSkDYVs0r+Qx/+nZ4r+N+lDq0NmIcCEsnzKdk7DNKtS PzNJ4K25Te/Lg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5E888690BC for ; Sat, 3 Jan 2026 13:33:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472389; bh=brRKZWrNRkCu2BYbXKhDItsTnbAhMY3H5kjFf5XZxSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hPYX7Bxnhd75nJ+HToG59wOBAD4wEjRsCVTV9oBlES9jEi5l3sRajp69eBIGktF72 KhmyxdeG/G/iC5GlYsWmA7uJREgZxNa0l16Tqrc4zgKGv+XQ7LKNoJflyI6VfpqFPr s1pPGYACHwryYm7susGRC2g+Ng77BQBQI0ldx+1JDUnzp1q039PwsOXWYM/Szz2KJx dVyVSuCm/nQOa3Rb4htOh+A2WXR2z+53yrFr5x4pk5t6/DaMxKC2alQGCGaDqngxz9 ImLB4kkkTRZ2S6ugv5RmemX+njdyqZEUGAWxjNxVTi+XB8n7g8knUQ6D3ig08+hRpw LFyilPWMhhHfQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 651D068F71; Sat, 3 Jan 2026 13:33:09 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 2RqazW-auKXf; Sat, 3 Jan 2026 13:33:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472385; bh=edFdXL7LO8K3ZUgNZwOloCsVN8Ta3xbVxmzkB6rWxyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e1LiL7yRt+u6y3/4Y+YBJjegTSqtmBDR7NlgQ8lFyls5aqANmr4vofxoZMpcWN2kK 7NfCw7hL50kJCfwbHdLqLf2SxN/UradBvTmkjJM23a0PU/uGh1ox8yAm3kORgmmhGt PE3FImMBaWc+KJgGds3ALaKJ4m24BvAdWT+pOp9nX64tEIGXxlwlKnadGFps8DKorU L/hfEIwyQkJRzsD4Oo0JZ1oqsfeV4EcjPklS0F3vCPuqMjt+TM5JV2+Jsh7zi1erhY Hte1r+K1TlhXparSkU390YFyn9v/xiweQA4QNbf8iM6PudWtIXl/CklCksFAzxmJva Pxh5pNj13HaUw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E45EA68FC8; Sat, 3 Jan 2026 13:33:04 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:29 -0700 Message-ID: <20260103203243.3727493-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: EZS6AWPYR5NH3C2LEAWQA7NRIEAROHOT X-Message-ID-Hash: EZS6AWPYR5NH3C2LEAWQA7NRIEAROHOT X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/12] buildman: Extract arch fixups from scan() into separate function List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the architecture fixup logic (aarch64 and riscv adjustments) into a new _fixup_arch() method to reduce complexity of scan(). Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index f503d8ef208..9dc5f9158d0 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -301,6 +301,19 @@ class KconfigScanner: params['target'] = expect_target + self._fixup_arch(params) + + return params, warnings + + def _fixup_arch(self, params): + """Fix up architecture names + + Handle cases where the architecture name needs adjustment based on + CPU type or other configuration. + + Args: + params (dict): Board parameters to update in place + """ # fix-up for aarch64 if params['arch'] == 'arm' and params['cpu'] == 'armv8': params['arch'] = 'aarch64' @@ -316,8 +329,6 @@ class KconfigScanner: else: params['arch'] = 'riscv64' - return params, warnings - class MaintainersDatabase: From patchwork Sat Jan 3 20:32:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1251 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472395; bh=0ou7+QPQXLUXmv1kscc8UTMy8eotsEJBuYvM8RFOE3Q=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kMV4ztSwb18YcdTx1Cmhha5108ty2Q8VXiUVQAtk4jaiIknnBxxMV2ZDRU1NyFl0z cnasBCxZW/ZdcHYm9NWiJmIVa4pUZoYst7cmAh2fTMSoL6Tmu9ySGsVSqgPZVra7+T NdOSREQRK0N++UiaUxicM8QW+FidZ1tEYSh2Q7ZY/EoRr2FnFaHjjVzqQL4uPWpX6v C4WNeHPZ9iud4y0LpJXKkp340JWTAHw2vcGlLThjWiT8JoqKtl+RSSt5HvVTGgQUUK Yg3WXc92XyjaYY2jiaaQ/6Esyx5NJfe0oD0bR1caJxeX4Ti06r67sNYPNzOaOBq/g2 00a3pQaefEskA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9215068F35 for ; Sat, 3 Jan 2026 13:33:15 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id J2kAJtmGircX for ; Sat, 3 Jan 2026 13:33:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472395; bh=0ou7+QPQXLUXmv1kscc8UTMy8eotsEJBuYvM8RFOE3Q=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kMV4ztSwb18YcdTx1Cmhha5108ty2Q8VXiUVQAtk4jaiIknnBxxMV2ZDRU1NyFl0z cnasBCxZW/ZdcHYm9NWiJmIVa4pUZoYst7cmAh2fTMSoL6Tmu9ySGsVSqgPZVra7+T NdOSREQRK0N++UiaUxicM8QW+FidZ1tEYSh2Q7ZY/EoRr2FnFaHjjVzqQL4uPWpX6v C4WNeHPZ9iud4y0LpJXKkp340JWTAHw2vcGlLThjWiT8JoqKtl+RSSt5HvVTGgQUUK Yg3WXc92XyjaYY2jiaaQ/6Esyx5NJfe0oD0bR1caJxeX4Ti06r67sNYPNzOaOBq/g2 00a3pQaefEskA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7A4F2690BC for ; Sat, 3 Jan 2026 13:33:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472393; bh=XeyWx2iuIb6lvWpDDkdkmxsvLTByX3UYVG6EUC3bRws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZWuezyWBd/dX7feRBtjO3QdIWIk23nhJyr4MIYMyPeBVDqxgByJ90XVnWbrdVCt/E ZnQoSqWXhCZMNcbJhxSrYMO0Ah9j1BRazT8MttSv4RCp6CQfvATgHslof/zJvprxDp PZEeni0I8TezburJcMi9kA9dJB92g0n8K/GGgVQWZufCWSZKTPN/0K6fJ/9FxPcT+C OjpGwAC2toh75tncAuDbJeJGkWVR0XvXKcBALH7R0MALGDWhMmjXGt0QeqOa6ioJU5 YvU/PrjQZ6G2vXbKFpsZ9a0WhaH1iYc2hkNAtJW2KeiZ7k75gHBAFyj1VhR/6Q7xkA UnEqsbf0EbuKA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C5E4D68F35; Sat, 3 Jan 2026 13:33:13 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id A6dbTwzBXBa0; Sat, 3 Jan 2026 13:33:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472389; bh=RtzrBxPmsgsfPMpe2UsNE4e3AgPEtlfZHbi7Ir+y2Hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iGWPQ6sngn5qn3yVHPWn/LFFDyobvlkzVWg2yic8f9itTp57MGo2DsBwXId9qCjOv DEDqmjo6XtX1jOZLwXWq++Y+6/jzT44NJnv1OFjDSQbtnTyHvJ6pRCeiQgLxcCKuH9 m6WvmqCnVJAV5wGvTTlPg5eIMZllpYUR6S7x8eMxmm2MhoflnD5afmfuDcU3C4iyy9 RXt3/519hB2TIyk/yV7hkB7dYhP5xhIaZoeeZt+CBr4GbOygHciZtL7KDLWOCQlvhh o+cxvKb3x5FosrRN6nmmgjVyP0sIsZUtPUpi3SMdcgSDrxDa9byqc4f+4371C6SpIJ +7X1aGJ1IkzPQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9B1A568FC8; Sat, 3 Jan 2026 13:33:09 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:30 -0700 Message-ID: <20260103203243.3727493-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 2IFM7GYOLYUPTFRIMALVXPIICXRMV3HG X-Message-ID-Hash: 2IFM7GYOLYUPTFRIMALVXPIICXRMV3HG X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/12] buildman: Use specific exception type in _fixup_arch() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Change bare except to catch AttributeError specifically, which occurs when the ARCH_RV32I symbol is not found and get() returns None Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 9dc5f9158d0..3b132691435 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -322,7 +322,7 @@ class KconfigScanner: if params['arch'] == 'riscv': try: value = self._conf.syms.get('ARCH_RV32I').str_value - except: + except AttributeError: value = '' if value == 'y': params['arch'] = 'riscv32' From patchwork Sat Jan 3 20:32:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1252 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472399; bh=nQdCSdiWX4kFuIauHlhV9DlkHc6xK3vV0neqv2ZpVBE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=wZVu/DKCvagfoQdpYPTs4HFe90TRYekoa2UZQB0anGqesaUtteguwhNNtiOV4ebU+ i4yrAjOkne4gWvml8V6/uOs1WG4dAkRi2eMyQHqVpqICG6nh7u4WCiWwpqC512aNDW /wzJhoCzPcsh7XVHQ7nGY2qrzHOoggQ9rucudohtnl3Yq4g9r4DT2BRoAiE0fMrDnp ps2l06n/h1UAWRsAXtC+fw6yNEWMKzAAUo0vJ+NFO1UYj3nGmrhXoKkK2mgwon+0I+ m9TERtuhBy/9Kx7de8vQyPJ0uUFfLjSaM+0cy8HFjZJvA4Ukcj8a6A/zRioAZ0zw2U meXBJaiGyan/A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B6FE2690BF for ; Sat, 3 Jan 2026 13:33:19 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id aLIGlQvz12n9 for ; Sat, 3 Jan 2026 13:33:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472399; bh=nQdCSdiWX4kFuIauHlhV9DlkHc6xK3vV0neqv2ZpVBE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=wZVu/DKCvagfoQdpYPTs4HFe90TRYekoa2UZQB0anGqesaUtteguwhNNtiOV4ebU+ i4yrAjOkne4gWvml8V6/uOs1WG4dAkRi2eMyQHqVpqICG6nh7u4WCiWwpqC512aNDW /wzJhoCzPcsh7XVHQ7nGY2qrzHOoggQ9rucudohtnl3Yq4g9r4DT2BRoAiE0fMrDnp ps2l06n/h1UAWRsAXtC+fw6yNEWMKzAAUo0vJ+NFO1UYj3nGmrhXoKkK2mgwon+0I+ m9TERtuhBy/9Kx7de8vQyPJ0uUFfLjSaM+0cy8HFjZJvA4Ukcj8a6A/zRioAZ0zw2U meXBJaiGyan/A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A2AD3690BC for ; Sat, 3 Jan 2026 13:33:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472398; bh=MV8LO7jGsPjTt8UOeyihJuP0Sv2Jrp98MaUoyDKMkYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rm9CpFnNvrf41f+cQLZTXw5UPR5cyFbpwXHvWaBjOjYDgW9t3ZTrSccVSPt+UPMGq lsh1hJuDLwp/uMP21kWQaS91t2afzGIJQ5+WP+zTI8B31SFLqJQ/4oyISLXDKwyQJf ZHF+8Nm+OOrJVDcv6yooPd0MxwtC36ebRuLpWGJaAliByfKCOfL8Shhon6nwaKLde6 6uA4HYTcliDZam4eL+mGpz6xoPVE03TdUV/+fz02CmdTiWXeHeEb6hDxfq+VgJqdGp 5/rygyxX5JjVZHpASyrM5h5SCZhHM0LCEGEKc9SAs8nnB7StAkDptXBN72DATAQZ5j 3nKWnH/BW+PJA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 832E968F35; Sat, 3 Jan 2026 13:33:18 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 6wWn73TmmEPG; Sat, 3 Jan 2026 13:33:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472394; bh=YGmPP3I4XnrSl4oqC87i7dnWX6eixY6sDMTnK7rpdaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TwrlvcqoqoM/yXoGLOTLSxYe6RQnLhYTyQBVmtftSZkhbVW05hUK0PCztbPrbvD3U urpjO7SxjnqBGnTnIk3BFUhvQ6v1Dj3vSX4CfGg8QN0oJ/TqV+8/ZpV4ZjYRNEU/9/ gelQm9inXuGZTzwUEWc0icwBCAWB2XOZJy6vtkGSNUCmYRePK+S+Itbw0zYAQ5cVxO gg7EHgwnSyjSKZDQfznRpcZuN/+DwTfa/ZLpCM+LDVhGg6aKJo2BcUcfvQICUuhGkd ufrqxjFH58ncwWqyPOS83cB42Vg3eCsIPKjnTFvxM0wBzlJEnDFIHVnI3o3E7HXfhX jz9azuS+G+8rw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 188B868FC8; Sat, 3 Jan 2026 13:33:14 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:31 -0700 Message-ID: <20260103203243.3727493-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JR7BV4R7TG4CL4CJ2RBMRCG55LGS5PRN X-Message-ID-Hash: JR7BV4R7TG4CL4CJ2RBMRCG55LGS5PRN X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/12] buildman: Extract tag parsing from parse() into _parse_tag() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the handling of tag lines (name:, desc:, fragment:, targets:) into a separate method to reduce complexity of parse() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 49 +++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 3b132691435..1983e4a50d6 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -1114,24 +1114,37 @@ class ExtendedParser: f'{fname}:{linenum}: Invalid target regex') self.targets.append(['regex', line.strip()]) else: - pair = line.split(':') - if len(pair) != 2: - raise ValueError(f'{fname}:{linenum}: Invalid tag') - tag, rest = pair - value = rest.strip() - if tag == 'name': - self.finish() - if ' ' in value: - raise ValueError(f'{fname}:{linenum}: Invalid name') - self.name = value - elif tag == 'desc': - self.desc = value - elif tag == 'fragment': - self.fragments.append(value) - elif tag == 'targets': - self.in_targets = True - else: - raise ValueError(f"{fname}:{linenum}: Unknown tag '{tag}'") + self._parse_tag(fname, linenum, line) self.finish() return self.extended + + def _parse_tag(self, fname, linenum, line): + """Parse a tag line (one not starting with a space) + + Args: + fname (str): Filename (for error messages) + linenum (int): Line number (for error messages) + line (str): Line to parse + + Raises: + ValueError: Invalid syntax + """ + pair = line.split(':') + if len(pair) != 2: + raise ValueError(f'{fname}:{linenum}: Invalid tag') + tag, rest = pair + value = rest.strip() + if tag == 'name': + self.finish() + if ' ' in value: + raise ValueError(f'{fname}:{linenum}: Invalid name') + self.name = value + elif tag == 'desc': + self.desc = value + elif tag == 'fragment': + self.fragments.append(value) + elif tag == 'targets': + self.in_targets = True + else: + raise ValueError(f"{fname}:{linenum}: Unknown tag '{tag}'") From patchwork Sat Jan 3 20:32:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1253 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472405; bh=BfvLYxFniUJVbYwo8QDyKFGIKi6SSVW7wKvyz7Bm2s4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=RCZfUzUimSPxlkgUXw0TzRoME5lBcgvXX2puV3sQR5jeXKkYevZaZBDDGmMhPBdm5 sOr7/dYLvzVHJiV4i21BgpYyIpg0icQE1SxmY+U+XFHQJks0k7Qp+69DOhLa7omft8 bYl+akP+IO2SWK7AMWId1UFBMQkHOSkPFez/OUglIXWYJfBoKc5dwPZK3paziY+FP0 5V9EQunncs5RYpaxYko4bierIBZLA39fPrv8H0q8N8+KgPH+IsUAjIZXmqkemxGzqp n5Um65vH2bcQpo+0KQM9Otonmp6We4GHYGWRbuVMnT5rrvlhKnKrVi0FONuzjSXZa1 byr0/36eD8aoQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 48544690BF for ; Sat, 3 Jan 2026 13:33:25 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 0Bv285-8Qyu7 for ; Sat, 3 Jan 2026 13:33:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472405; bh=BfvLYxFniUJVbYwo8QDyKFGIKi6SSVW7wKvyz7Bm2s4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=RCZfUzUimSPxlkgUXw0TzRoME5lBcgvXX2puV3sQR5jeXKkYevZaZBDDGmMhPBdm5 sOr7/dYLvzVHJiV4i21BgpYyIpg0icQE1SxmY+U+XFHQJks0k7Qp+69DOhLa7omft8 bYl+akP+IO2SWK7AMWId1UFBMQkHOSkPFez/OUglIXWYJfBoKc5dwPZK3paziY+FP0 5V9EQunncs5RYpaxYko4bierIBZLA39fPrv8H0q8N8+KgPH+IsUAjIZXmqkemxGzqp n5Um65vH2bcQpo+0KQM9Otonmp6We4GHYGWRbuVMnT5rrvlhKnKrVi0FONuzjSXZa1 byr0/36eD8aoQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 37AA2690BC for ; Sat, 3 Jan 2026 13:33:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472403; bh=uZvOUigdmeY06tVCpb0r+kiMEwaseBPjBlbSsROdiNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M3RhSDSXlFVY//TLL+pxrHBBjOPwK9bg+Un4j41RRkbTqIWtHmyuETCiPE4fpJfnl /6BLhuERGhlNry9egctXxmlCVvSWGOoggI+I4K7TmD77nzmb73DQbzdiuqqAh9oHUT ZuAo5KyW48drN1vQUT+43/V8jjIRwvCYZd44sIFLLW5gzOSB3Cal2AVFoS/CEMDf67 CGCapLe063K/eKNqhoyWgD3+ZOAmN/ByvBGbNWz0uyI5ucogInUfKYKqkv8G4PKdWZ jz+oFMy65W2rbR7S1hazpgbQj//zNotwVFBQ/SXkfP04YiIGBQgiOgkz3LySec6rv/ 8+ul3CeB+nOrA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 47E4568F35; Sat, 3 Jan 2026 13:33:23 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id P-zS9sZx4sCB; Sat, 3 Jan 2026 13:33:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472399; bh=jqWz4OtMJ//hvFqPc8yYHXPofjNltgI0VB7SI0o78A4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T8RYmbAe7bEZyGdq6jQYOahFMEoBT70S6uW/tDUqDAN5qKomr4YmloEC0Nr8NcI8p Q+w2ZUGxXSQDP/KUDQGA770c+mi3ECbys/P4sWq6uPUm4UEhUG88TFHKu77hou3xKa x+vL/J5Dy8lA4+hQtVopIi438EPyH2vnag2oUI/PsFGqDe6ck2aIXtNB+t1ky+Ce0f xm63uhYrtdkeW/3zvQUPyiavZGq5+mJT7WgD75jDv4CrBY9a2/bz5f60oDGZLhWg5u kkgNDbHEMnN1eiPAF1KYaDYZLi4tR9aBwxsBYQ0PNLzvJd56oHyC1k4v/dUgQUDxOr wBoTVnlbHqpjg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C637768FC8; Sat, 3 Jan 2026 13:33:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:32 -0700 Message-ID: <20260103203243.3727493-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: PX4ECIA75CUVGWYOLBFUUZX53LPIUDQG X-Message-ID-Hash: PX4ECIA75CUVGWYOLBFUUZX53LPIUDQG X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/12] buildman: Extract defconfig loading from scan() into _load_defconfig() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the logic that handles #include preprocessing and config loading into a separate method to reduce complexity of scan() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 53 ++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 1983e4a50d6..e7844f0e5e7 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -222,6 +222,37 @@ class KconfigScanner: if self._tmpfile: try_remove(self._tmpfile) + def _load_defconfig(self, defconfig): + """Load a defconfig file, preprocessing if needed + + If the defconfig contains #include directives, run the C + preprocessor to expand them before loading. + + Args: + defconfig (str): Path to the defconfig file + """ + temp = None + if b'#include' in tools.read_file(defconfig): + cpp = os.getenv('CPP', 'cpp').split() + cmd = cpp + [ + '-nostdinc', '-P', + '-I', self._srctree, + '-undef', + '-x', 'assembler-with-cpp', + defconfig] + stdout = command.output(*cmd, capture_stderr=True) + temp = tempfile.NamedTemporaryFile(prefix='buildman-') + tools.write_file(temp.name, stdout, False) + fname = temp.name + tout.info(f'Processing #include to produce {defconfig}') + else: + fname = defconfig + + self._conf.load_config(fname) + if temp: + del temp + self._tmpfile = None + def scan(self, defconfig, warn_targets): """Load a defconfig file to obtain board parameters. @@ -247,27 +278,7 @@ class KconfigScanner: expect_target, match, rear = leaf.partition('_defconfig') assert match and not rear, f'{leaf} : invalid defconfig' - temp = None - if b'#include' in tools.read_file(defconfig): - cpp = os.getenv('CPP', 'cpp').split() - cmd = cpp + [ - '-nostdinc', '-P', - '-I', self._srctree, - '-undef', - '-x', 'assembler-with-cpp', - defconfig] - stdout = command.output(*cmd, capture_stderr=True) - temp = tempfile.NamedTemporaryFile(prefix='buildman-') - tools.write_file(temp.name, stdout, False) - fname = temp.name - tout.info(f'Processing #include to produce {defconfig}') - else: - fname = defconfig - - self._conf.load_config(fname) - if temp: - del temp - self._tmpfile = None + self._load_defconfig(defconfig) params = {} warnings = [] From patchwork Sat Jan 3 20:32:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1254 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472409; bh=wPovyIfAXqDusLEUnRcpPDkLxgb59d5O8r4ELb4pTJ0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=YydVMhkto6VG/IKffv1Knjzj0QE3UnrN0v5ZPk1vAEOyHOzPDr0SmdAa5yLcjCPuh 1JOCj1YHauqvmqkmQWMx6cRjXXD+IGINBLE673/443lZoD49ylbnitbg+PwgPh8ilD 7dBMeMhy5fbnH688lAL8bDNGCTT0UeIGVN7Lju2fiR7UVTm9fQfBjk1SUp+t6u2OLk n6ZpYKsSBYY/hUPAmwooKbqidegX9w1uH7cfBekdokvLGMKxGFPTuaEC7k+lAa0Bvr khxSFYB4NezSIRACcZVKM1Xgun0Vq6CLnZHnOAee9ryG+W1jQAbBQ3ZnOyRdfPjzjh TrP0T36k2Xehw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D16E5690BF for ; Sat, 3 Jan 2026 13:33:29 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id UA9gVQlYzcmx for ; Sat, 3 Jan 2026 13:33:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472409; bh=wPovyIfAXqDusLEUnRcpPDkLxgb59d5O8r4ELb4pTJ0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=YydVMhkto6VG/IKffv1Knjzj0QE3UnrN0v5ZPk1vAEOyHOzPDr0SmdAa5yLcjCPuh 1JOCj1YHauqvmqkmQWMx6cRjXXD+IGINBLE673/443lZoD49ylbnitbg+PwgPh8ilD 7dBMeMhy5fbnH688lAL8bDNGCTT0UeIGVN7Lju2fiR7UVTm9fQfBjk1SUp+t6u2OLk n6ZpYKsSBYY/hUPAmwooKbqidegX9w1uH7cfBekdokvLGMKxGFPTuaEC7k+lAa0Bvr khxSFYB4NezSIRACcZVKM1Xgun0Vq6CLnZHnOAee9ryG+W1jQAbBQ3ZnOyRdfPjzjh TrP0T36k2Xehw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BEF39690BC for ; Sat, 3 Jan 2026 13:33:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472408; bh=bFE2t9KoZ5CbF5Wd6WIZccBKOYz95liY+Let7/EHY5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQuXy+5PjbfImhqLOhxsVt9NO8OlYJwIISf/yndlMqOPq7V+uVmjR8AQOUX96R+wc muqIFnADdL3LnxMvUAzw7pU1l7LfxEH5vT6ksiiy3lAGgFdmLRYeNM11TSBd/q0aP8 RmULoUsbf/ekKIFv63aiBXF0YJe1gcXQASf2haURAWEPbuah8e4TVbsNjoAFcGrzsK TesAgLxapP9z0cQAsjH21pO2WaEm8q3i2HgD8EMgXKxAYpTgOd02Izh9oH9RMLnY4s HgroL2gH+D3DlhzfzAF+El36udF1p5rjR4gxYxlcviQfg74+8rsoTsfD3y85qKOaaD 44P7OLTKosYjA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0081868F35; Sat, 3 Jan 2026 13:33:28 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Pi8ab-eS1jYw; Sat, 3 Jan 2026 13:33:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472403; bh=x6jPYuwGddUMkjDAE6wBBoPBA3jHg55aLkSFc9L9fns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LOzdF1k6DAvtrp0c/aoie8sthOjvyCilMuGHXMgCB01QYnnMbe5TUVkejviSwW40s w1ejwzndEHKaaK4Vr3E6VcxiaPoojkaigiKH++WCIKGNl05Hs7XqQyf4j02vJWBQ4c wYU0YOOZmd4tiuIoJq/3mjqp+5JDkmVssireLsWefWvNAqh2c5JVZoRKoi3fnQOIye 17Ngj2CdzbZgq8uNFYCBRiNxmR+LmKCYpkKOXemeV7RzoPNdl3nA3jlqQm2pzW2lpk tVcGAeCI/8jK7Fr0wCvI40gaYaerzRJ3FnpXWDelaEAvW/WZN7tFVLJIgoDOpy4XkE f8mk5LmUtP1Pw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 88D9E68FC8; Sat, 3 Jan 2026 13:33:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:33 -0700 Message-ID: <20260103203243.3727493-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YW7ZSPA3M2KAINIQZ32XNJ4LTPQUWPUM X-Message-ID-Hash: YW7ZSPA3M2KAINIQZ32XNJ4LTPQUWPUM X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/12] buildman: Extract target checking from scan() into _check_targets() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the logic that verifies exactly one TARGET_xxx option is set into a separate method to reduce complexity of scan() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 45 ++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index e7844f0e5e7..74f654c6813 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -294,21 +294,7 @@ class KconfigScanner: # Check there is exactly one TARGET_xxx set if warn_targets: - target = None - for name, sym in self._conf.syms.items(): - if name.startswith('TARGET_') and sym.str_value == 'y': - tname = name[7:].lower() - if target: - warnings.append( - f'WARNING: {leaf}: Duplicate TARGET_xxx: ' - f'{target} and {tname}') - else: - target = tname - - if not target: - cfg_name = expect_target.replace('-', '_').upper() - warnings.append( - f'WARNING: {leaf}: No TARGET_{cfg_name} enabled') + warnings += self._check_targets(leaf, expect_target) params['target'] = expect_target @@ -340,6 +326,35 @@ class KconfigScanner: else: params['arch'] = 'riscv64' + def _check_targets(self, leaf, expect_target): + """Check that exactly one TARGET_xxx option is set + + Args: + leaf (str): Leaf name of defconfig file (for warnings) + expect_target (str): Expected target name + + Returns: + list of str: List of warnings found + """ + warnings = [] + target = None + for name, sym in self._conf.syms.items(): + if name.startswith('TARGET_') and sym.str_value == 'y': + tname = name[7:].lower() + if target: + warnings.append( + f'WARNING: {leaf}: Duplicate TARGET_xxx: ' + f'{target} and {tname}') + else: + target = tname + + if not target: + cfg_name = expect_target.replace('-', '_').upper() + warnings.append( + f'WARNING: {leaf}: No TARGET_{cfg_name} enabled') + + return warnings + class MaintainersDatabase: From patchwork Sat Jan 3 20:32:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1255 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472414; bh=e1eyuy3hJpFBdqtLQV0UbPjDt73Av9lvcyMlqX/Gzpk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pwNYIuthMrBWkGjZqcapUa0tWr04cm74F995HfL61IyDmZo/AL0ckKLHwMj1tY4zG 1w/MudTVfqHpFnTWd/cskdRQk33+ksPEPm27VrlBx4N1IuPsjnN/bGbQqG4pRaR0Y0 TEcIaCzDTF99zY/PKVqK4V6XgrVai772OhTn4kfW2O8tOwz36a4n5IrYuaG+Zhgg6l zmH2cstINDMW/BmMBNGva5rSRugqn2RM/rig9tDAZ8MEl0UFaIrFg9H2Yp1aZhb4KQ 1rpiihASVp95g4raCizqfGRqHbuYggCMM/QBYTb7TDXoYGpbMJSJiX9QNx+bVU/f6P 65SNWENHdLO9g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AB4C3690C0 for ; Sat, 3 Jan 2026 13:33:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id TfZ9IUlvSI9e for ; Sat, 3 Jan 2026 13:33:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472414; bh=e1eyuy3hJpFBdqtLQV0UbPjDt73Av9lvcyMlqX/Gzpk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pwNYIuthMrBWkGjZqcapUa0tWr04cm74F995HfL61IyDmZo/AL0ckKLHwMj1tY4zG 1w/MudTVfqHpFnTWd/cskdRQk33+ksPEPm27VrlBx4N1IuPsjnN/bGbQqG4pRaR0Y0 TEcIaCzDTF99zY/PKVqK4V6XgrVai772OhTn4kfW2O8tOwz36a4n5IrYuaG+Zhgg6l zmH2cstINDMW/BmMBNGva5rSRugqn2RM/rig9tDAZ8MEl0UFaIrFg9H2Yp1aZhb4KQ 1rpiihASVp95g4raCizqfGRqHbuYggCMM/QBYTb7TDXoYGpbMJSJiX9QNx+bVU/f6P 65SNWENHdLO9g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 91DC5690BD for ; Sat, 3 Jan 2026 13:33:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472412; bh=0ryqwUbyvrnBPErEu6cDeTR2bdjdRyLrc1xCaceL6rs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QT3FGMqYewuO6G8ZQ11WmCmtdKtFtJ60TCQoHmmA26aM05UHdb7xcONscddT+w/3g q7a4M2CphtslHM9Cf+cRlP1bg9F5ec8FKR4lHNa64+cM2oKMDk/yIe5jslY1puVeU3 YGroPaDaw8EeZU8h8SkEnXAPm/6tQftDEB5IXoQLHJCSfvdEuXSTYJZ3B5lE+Ts45O NBRKTqOCcpWAAwyb61V7dKmor45kwW//u1SymUOxxgKXXVQAT9otFgfnYYG8BHt2qc 2x8sCyiJqEICvt6t/lcq+neEiPMnhqf7xlaFglrEHpf8bBLE9eTJPQPaFGJj3wULfF cU21khz7xc6fw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B88D668F35; Sat, 3 Jan 2026 13:33:32 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Oh9GNuKQj27e; Sat, 3 Jan 2026 13:33:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472408; bh=1ch7ehAOrTLH9hImp+PuzAfewiT/ygRmDpdqLihcL/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vWnQhfM7b2A6nDZoNT0oe9AYhLbtIVAMOHJVaLrq8CslyTQ4bNguWrDx50kP3gIaO lYMFYvvlAI3tBeckguAJ6QfM3K/ZuUbFmyZnUt8UQeLoC8v36aBxdcQuJ4X1bFR4pT et0a4IKvtv1pm2vuBHo0kx1z3fs9Fn1jf9mZjqemrLL7mk/fHthmd3MBn4XVxeTk9H c/YB2JYQkFu/bRqLglrcO42i0M/NzRuZ8tXGjdw5tCEoRfYlvlNYy8OcUeeAdiwU41 2mjNlcWP5KomazjsjLZ9IFnzbNXCCoRof4aSFc4EJK7lDzNNYt61P/P+LcwuqwXTl+ PHUQ7tjFAtDmA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4363C68FC8; Sat, 3 Jan 2026 13:33:28 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:34 -0700 Message-ID: <20260103203243.3727493-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4RSARBUTXXTW3WGMUTFLIN6EO6LH6DGD X-Message-ID-Hash: 4RSARBUTXXTW3WGMUTFLIN6EO6LH6DGD X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/12] buildman: Extract F: and N: tag handling in parse_file() into methods List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the handling of F: (file path) and N: (name pattern) tags into separate class methods _handle_f_tag() and _handle_n_tag(), and target database updates into _add_targets() This reduces complexity of parse_file() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 96 ++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 38 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 74f654c6813..36e9ba1f549 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -421,6 +421,60 @@ class MaintainersDatabase: self.warnings.append(f"WARNING: no maintainers for '{target}'") return '' + def _add_targets(self, targets, status, maintainers): + """Add targets to the database + + Args: + targets (list of str): List of target names + status (str): Board status + maintainers (list of str): List of maintainers + """ + for target in targets: + self.database[target] = (status, maintainers) + + @staticmethod + def _handle_f_tag(srcdir, rest, targets): + """Handle F: tag - expand wildcard and filter by defconfig + + Args: + srcdir (str): Source directory + rest (str): Remainder of line after 'F:' + targets (list of str): List to append targets to + """ + glob_path = os.path.join(srcdir, rest) + for item in glob.glob(glob_path): + front, match, rear = item.partition('configs/') + if front.endswith('/'): + front = front[:-1] + if front == srcdir and match: + front, match, rear = rear.rpartition('_defconfig') + if match and not rear: + targets.append(front) + + @staticmethod + def _handle_n_tag(srcdir, rest, targets): + """Handle N: tag - scan configs dir and match with regex + + Args: + srcdir (str): Source directory + rest (str): Remainder of line after 'N:' + targets (list of str): List to append targets to + """ + walk_path = os.walk(os.path.join(srcdir, 'configs')) + for dirpath, _, fnames in walk_path: + for cfg in fnames: + path = os.path.join(dirpath, cfg)[len(srcdir) + 1:] + front, match, rear = path.partition('configs/') + if front or not match: + continue + front, match, rear = rear.rpartition('_defconfig') + + # Use this entry if it matches the defconfig file + # without the _defconfig suffix. For example + # 'am335x.*' matches am335x_guardian_defconfig + if match and not rear and re.search(rest, front): + targets.append(front) + def parse_file(self, srcdir, fname): """Parse a MAINTAINERS file. @@ -438,16 +492,6 @@ class MaintainersDatabase: srcdir (str): Directory containing source code (Kconfig files) fname (str): MAINTAINERS file to be parsed """ - def add_targets(linenum): - """Add any new targets - - Args: - linenum (int): Current line number - """ - if targets: - for target in targets: - self.database[target] = (status, maintainers) - targets = [] maintainers = [] status = '-' @@ -460,41 +504,17 @@ class MaintainersDatabase: if tag == 'M:': maintainers.append(rest) elif tag == 'F:': - # expand wildcard and filter by 'configs/*_defconfig' - glob_path = os.path.join(srcdir, rest) - for item in glob.glob(glob_path): - front, match, rear = item.partition('configs/') - if front.endswith('/'): - front = front[:-1] - if front == srcdir and match: - front, match, rear = rear.rpartition('_defconfig') - if match and not rear: - targets.append(front) + self._handle_f_tag(srcdir, rest, targets) elif tag == 'S:': status = rest elif tag == 'N:': - # Just scan the configs directory since that's all we care - # about - walk_path = os.walk(os.path.join(srcdir, 'configs')) - for dirpath, _, fnames in walk_path: - for cfg in fnames: - path = os.path.join(dirpath, cfg)[len(srcdir) + 1:] - front, match, rear = path.partition('configs/') - if front or not match: - continue - front, match, rear = rear.rpartition('_defconfig') - - # Use this entry if it matches the defconfig file - # without the _defconfig suffix. For example - # 'am335x.*' matches am335x_guardian_defconfig - if match and not rear and re.search(rest, front): - targets.append(front) + self._handle_n_tag(srcdir, rest, targets) elif line == '\n': - add_targets(linenum) + self._add_targets(targets, status, maintainers) targets = [] maintainers = [] status = '-' - add_targets(linenum) + self._add_targets(targets, status, maintainers) class Boards: From patchwork Sat Jan 3 20:32:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1256 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472419; bh=LHUoeZveE7MaeWpKTVcGpBcCBDUtsZ2ktA50tSF+5pE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pIIx5Mov5ie81q3VKjfhHFS5ggTJLUuqgHQcMiRtKJhEHU3RHXy7YxUuAfE0qjcwm UTaJEmZMBL3tfwOP1lmh5XMjYNmgKogxih0s/zo9CcO6P2F4GYE4LziFf6N/h3ANj4 xyCMBcMib5fEvF0nMsZ9WEyn09SgqulNWNqDke8D4n+7yubmf8UTMHBmDoYDZJFj8s l2CK3yO4iGqHqiNb/uaOEy4WDNdfWP/EKzLXl9b56TNe5+DsDS84gNVswvw3GD8sn1 ipTWqMV640KGKpByik+xvF8M1DMvYXlcnMv7qVRlHh6KsJbPKjanoHjTGC7+cfY0RG aqos0cc6P3mOg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 56A4E690C0 for ; Sat, 3 Jan 2026 13:33:39 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id QktagOPPJc2g for ; Sat, 3 Jan 2026 13:33:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472419; bh=LHUoeZveE7MaeWpKTVcGpBcCBDUtsZ2ktA50tSF+5pE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pIIx5Mov5ie81q3VKjfhHFS5ggTJLUuqgHQcMiRtKJhEHU3RHXy7YxUuAfE0qjcwm UTaJEmZMBL3tfwOP1lmh5XMjYNmgKogxih0s/zo9CcO6P2F4GYE4LziFf6N/h3ANj4 xyCMBcMib5fEvF0nMsZ9WEyn09SgqulNWNqDke8D4n+7yubmf8UTMHBmDoYDZJFj8s l2CK3yO4iGqHqiNb/uaOEy4WDNdfWP/EKzLXl9b56TNe5+DsDS84gNVswvw3GD8sn1 ipTWqMV640KGKpByik+xvF8M1DMvYXlcnMv7qVRlHh6KsJbPKjanoHjTGC7+cfY0RG aqos0cc6P3mOg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 447D8690B2 for ; Sat, 3 Jan 2026 13:33:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472417; bh=65etRMyXyLPypVErrGtx6FhjPQz+abSlfdv4ZN1Ux2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NQ0MTliQH1nb2jxsR4iLO3t6YwHAWs34AxE8TuSp/qC0cEFRjjnbt7A0qzOUiHxpl KGSBKCF23XSzRvIiu1cvLbtOPB5CYHXP93Hq2DwzV0L8CEFsZVAQ6vqLC169ZoZN92 HkSOylxYPgkz5wOHRCn8mvOrodKh0aFPlQ8DbqzMjCgdbFLSMZUZnKSe3qeUFJJv/e MKaHh/BLBKO6IYnswN4dfpeblcIRuPFsc+2LZyrQce+BfupVxiPGXqVYBa6VYVwl5o lGF/4WUZ5eowji+iMqULTgE6NjJgvKhvDycd7NIvFKBn/v8OGvdwWyJDdw0br6GFuR Nd2+ZO9yaWh2w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9E99C68F35; Sat, 3 Jan 2026 13:33:37 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id sgKYA2vNaidP; Sat, 3 Jan 2026 13:33:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472413; bh=AY++wEfDd5cWRsBqw7lkSd04yLAJ0HBjy00BBUkTBqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pgxTHkxTAuotXJYIPWXk1JBYZj1QZwwWoDCiu1lHAemHvvJoj4hAJPjqEJOBLu4qw TTewOZHaiWH7X2rwXAfowyqmad7vpytDl7+YYDehVERfwJYYS017NH4sX6/22qagFU wTqC39SSzcVOPDwXrvs6TcqWIpzFK5g+bZZ3XfL3FIPgStuebQFhnIBjNE0Wfz6v/J VK0e0pe6GTDFQGoa+ydExm4z8/wAylfYXFZ3o41ip1tbKS7L2QQqrVlUsaoYVb6vX8 kGvnGzjP1vIRHszgrW/xGcAdksYk6Lt+Vo+ETosQFWmQImx31iIay21Z+ISK/9AZaU GDvvZsChdk9WA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 077B168FC8; Sat, 3 Jan 2026 13:33:32 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:35 -0700 Message-ID: <20260103203243.3727493-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UCMRTPAWWGYZJDTT2ME6KZJOD2MQBJYD X-Message-ID-Hash: UCMRTPAWWGYZJDTT2ME6KZJOD2MQBJYD X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/12] buildman: Split _start_defconfig_scans() into two functions List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Split the setup logic into _collect_defconfigs() for gathering defconfig file paths and _start_scanners() for spawning the parallel scan processes. This reduces complexity and eliminates the too-many-locals warning. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 60 ++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 36e9ba1f549..46e78b55809 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -785,25 +785,15 @@ class Boards: params_list.append(params) warnings.update(warn) - def scan_defconfigs(self, config_dir, srcdir, jobs=1, warn_targets=False): - """Collect board parameters for all defconfig files. - - This function invokes multiple processes for faster processing. + @staticmethod + def _collect_defconfigs(config_dir): + """Collect all defconfig files from a directory Args: config_dir (str): Directory containing the defconfig files - srcdir (str): Directory containing source code (Kconfig files) - jobs (int): The number of jobs to run simultaneously - warn_targets (bool): True to warn about missing or duplicate - CONFIG_TARGET options Returns: - tuple: - list of dict: List of board parameters, each a dict: - key: 'arch', 'cpu', 'soc', 'vendor', 'board', 'target', - 'config' - value: string value of the key - list of str: List of warnings recorded + list of str: Paths to all defconfig files found """ all_defconfigs = [] for (dirpath, _, filenames) in os.walk(config_dir): @@ -811,7 +801,23 @@ class Boards: if fnmatch.fnmatch(filename, '.*'): continue all_defconfigs.append(os.path.join(dirpath, filename)) + return all_defconfigs + + def _start_scanners(self, all_defconfigs, srcdir, jobs, warn_targets): + """Start parallel defconfig scanning processes + + Args: + all_defconfigs (list of str): Paths to defconfig files to scan + srcdir (str): Directory containing source code (Kconfig files) + jobs (int): The number of jobs to run simultaneously + warn_targets (bool): True to warn about missing or duplicate + CONFIG_TARGET options + Returns: + tuple: + list of Process: Running scanner processes + list of Queue: Queues for receiving results + """ total_boards = len(all_defconfigs) processes = [] queues = [] @@ -826,6 +832,32 @@ class Boards: processes.append(proc) queues.append(que) + return processes, queues + + def scan_defconfigs(self, config_dir, srcdir, jobs=1, warn_targets=False): + """Collect board parameters for all defconfig files. + + This function invokes multiple processes for faster processing. + + Args: + config_dir (str): Directory containing the defconfig files + srcdir (str): Directory containing source code (Kconfig files) + jobs (int): The number of jobs to run simultaneously + warn_targets (bool): True to warn about missing or duplicate + CONFIG_TARGET options + + Returns: + tuple: + list of dict: List of board parameters, each a dict: + key: 'arch', 'cpu', 'soc', 'vendor', 'board', 'target', + 'config' + value: string value of the key + list of str: List of warnings recorded + """ + all_defconfigs = self._collect_defconfigs(config_dir) + processes, queues = self._start_scanners(all_defconfigs, srcdir, jobs, + warn_targets) + # The resulting data should be accumulated to these lists params_list = [] warnings = set() From patchwork Sat Jan 3 20:32:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1257 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472424; bh=Y39LUJe2AGUqhruNLU7hkoCJFQOHQjeaBBFJHz3REf8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=O9Yuf50PQGBnc885U1uO+eVgYvtOYF1jJcjrAc50Up3RieQ1X9EhjZOw4zq1U7ItJ EW+hr8/e0TsMbhGZX+layVBHueXoxBCTdYqd6TWuwf3dm200aUPCXcmtAOV+VEbdhE 46p7XZ5qDkzKt9t45RWyKJ5b6V59+tEbV0kmdBBUHcYLu1xuKTWjhFmHp/EizQwAwz CBLHVC+Blk87x+CVw6aQUImgOQe2IM5kn5Kf8qgZCmV6RJsDPoy7QBX2SR9Ka2yl8r qGdVAfbyT+cIAYUml8cBbWiaV904raFoScX51bpRRiQphao8AOk9tCHgOUKBPvK+4M RJv9qWg6MAs6g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0F3AC690C1 for ; Sat, 3 Jan 2026 13:33:44 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ofSRFzDOqYZL for ; Sat, 3 Jan 2026 13:33:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472423; bh=Y39LUJe2AGUqhruNLU7hkoCJFQOHQjeaBBFJHz3REf8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DLcs2Q4PX5UCHKpuyKcijwpBck1rV0nfR1a3J72mmNl77UhUosLmg5pDi3XF87+Fv INrLtvR5wJwPCI1p5t4h+sTLv51m8chsCn/5vlodw81sT8kDqsK2XbFj1g1uA6b5q6 pGDGEHF/r0HJOe2o6qNyZR3JuqlY9UQvfKgffBW/OPa42bGvReQX9xJ1b8ZexnJHBS VI3FFKbovxqDZ5egjXgymAmOTZvmcNIYR8ULSqa6pjvakkQ6jYK8fs3bY+IxLBwcj6 qMh1jKT4TLr9+M/4cxiiWhRXA6XLbAQXfRBazSNN9WiTVHGJ6SCneP8gt8cnOh63mP w67C4s+k2C6pA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F01A0690B2 for ; Sat, 3 Jan 2026 13:33:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472422; bh=bouNbEsfPec5UGqa5Kp9F+w+8b2nBiIAuGfNTFDKVMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IKvXRe4V93PTPseUu6No71Ruf5jF+hGypEIu79m/Jw2/SRU+Zt9brn7NiiljVWl3s tursAxDyCNnpWp2RtGB3yQs/sF8AQNblYbTWkIceOq9k7ZMFM6IdYAhgvw1KePDOr+ kuJLtXKyQHkX7rULkHEINlzX/eaVUSepk72tYLq1SzmK/LQoyRuCan2AKc0YCctd/b 1ZakaCq944jcaQeTVUWZZzDivRu57Yuuz/xooB781JRIhImX7zB1UoAwzsO95nxIVc 8/ZaGnNDxof4Bdad/2ogQMT9GN+XGQqozT4kmYxkrck4vAr5W7lhSz3/fRbtuRWnMI XLlEb9lIkXKqg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5861668F35; Sat, 3 Jan 2026 13:33:42 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Y6qburAnNoTk; Sat, 3 Jan 2026 13:33:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472418; bh=4ZiXucmnypHSh8dNpMKmY3paeaGD9N7Uq2qlVRzNPP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OZTZTqlVy7EtnTzFo0ojUoaQrfog8nUcKLQjVcf1AIk9rm4VtvfsezYCSqKizBlyv nm2wOz+GFAzYMZk1tS61kJOBrjn7bdFJx8W/KTvlhNWI0AtHVhviCPLuSBf/KUQKm1 Asu+Xyw7ZlRHsqYEJAum8ILvfL5Nw+FmGwuE2RQZFD1y6ftNFnDsupz1Bo7u6QddQn fOwvZ2rmSFsIda0jGB8q5qVnJr0/ei+09W67YqXDdBCXJNCixEsdH3EbNf0ZLJW3Zs zhxIMhOjSoLMU710WG6zZZSuOlxH4DbYFbxWtD2jPVLjSeDpkJAcYcckWilr/RotXj WLDJnBsNqsgJQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DC4B068FC8; Sat, 3 Jan 2026 13:33:37 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:36 -0700 Message-ID: <20260103203243.3727493-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: OPTHGGSVINECGMW5WHDDBRR7WLHETBD3 X-Message-ID-Hash: OPTHGGSVINECGMW5WHDDBRR7WLHETBD3 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/12] buildman: Extract helper functions from output_is_new() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the srcdir walk and output file scanning into module-level functions _check_srcdir_is_current() and _check_output_is_current() to reduce complexity. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 69 ++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 46e78b55809..0aea4bc826c 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -56,6 +56,50 @@ def try_remove(fname): raise +def _check_srcdir_is_current(ctime, srcdir): + """Check if any Kconfig or MAINTAINERS files are newer than ctime + + Args: + ctime (float): Reference time to compare against + srcdir (str): Directory containing Kconfig and MAINTAINERS files + + Returns: + bool: True if all files are older than ctime + """ + for (dirpath, _, filenames) in os.walk(srcdir): + for filename in filenames: + if (fnmatch.fnmatch(filename, '*~') or + not fnmatch.fnmatch(filename, 'Kconfig*') and + not filename == 'MAINTAINERS'): + continue + filepath = os.path.join(dirpath, filename) + if ctime < os.path.getctime(filepath): + return False + return True + + +def _check_output_is_current(output, config_dir): + """Check if output references any removed boards + + Args: + output (str): Path to the output file + config_dir (str): Directory containing defconfig files + + Returns: + bool: True if all referenced boards still exist + """ + with open(output, encoding="utf-8") as inf: + for line in inf: + if 'Options,' in line: + return False + if line[0] == '#' or line == '\n': + continue + defconfig = line.split()[6] + '_defconfig' + if not os.path.exists(os.path.join(config_dir, defconfig)): + return False + return True + + def output_is_new(output, config_dir, srcdir): """Check if the output file is up to date. @@ -75,7 +119,6 @@ def output_is_new(output, config_dir, srcdir): Raises: OSError: output file exists but could not be opened """ - # pylint: disable=too-many-branches try: ctime = os.path.getctime(output) except OSError as exception: @@ -92,27 +135,11 @@ def output_is_new(output, config_dir, srcdir): if ctime < os.path.getctime(filepath): return False - for (dirpath, _, filenames) in os.walk(srcdir): - for filename in filenames: - if (fnmatch.fnmatch(filename, '*~') or - not fnmatch.fnmatch(filename, 'Kconfig*') and - not filename == 'MAINTAINERS'): - continue - filepath = os.path.join(dirpath, filename) - if ctime < os.path.getctime(filepath): - return False + if not _check_srcdir_is_current(ctime, srcdir): + return False - # Detect a board that has been removed since the current board database - # was generated - with open(output, encoding="utf-8") as inf: - for line in inf: - if 'Options,' in line: - return False - if line[0] == '#' or line == '\n': - continue - defconfig = line.split()[6] + '_defconfig' - if not os.path.exists(os.path.join(config_dir, defconfig)): - return False + if not _check_output_is_current(output, config_dir): + return False return True From patchwork Sat Jan 3 20:32:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1258 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472428; bh=yrI7cacio1UjebiqKhAQR3wf5bS0Y2asIqHk4qaHfEo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=a60MAag4MYygC2GsmGkRmth6Ok0F4H7S3DopReIHvz1WgQLYEuT4mEDJbN5uyDXQp BGGume5BCNuZwtaGhXrttVaApERiLf4L308/+0yGzjDNYm8sGyu0DzWTICbP5n2Hgt deM94InHqa/c5iTHcF+dC+kqlYAnWLuqmCMCJkjBtaixhbygKKlurJ2ShhFu505Kwf XsVGT8UXCW/dUEE4bensUE/2BTjWYYiSugbMgkH4eG53pzXWXc38juwxOqWufDKFvI jUPHj/QlItoOpSLOTuYqyYTxAPVJfA+FIvIlsiL2ne3DMLkeFqQecnt+hf0vucX4uH 4tzNKx2tuHDFw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9A82E690C1 for ; Sat, 3 Jan 2026 13:33:48 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id iwr7uyv3J2Vp for ; Sat, 3 Jan 2026 13:33:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472428; bh=yrI7cacio1UjebiqKhAQR3wf5bS0Y2asIqHk4qaHfEo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=a60MAag4MYygC2GsmGkRmth6Ok0F4H7S3DopReIHvz1WgQLYEuT4mEDJbN5uyDXQp BGGume5BCNuZwtaGhXrttVaApERiLf4L308/+0yGzjDNYm8sGyu0DzWTICbP5n2Hgt deM94InHqa/c5iTHcF+dC+kqlYAnWLuqmCMCJkjBtaixhbygKKlurJ2ShhFu505Kwf XsVGT8UXCW/dUEE4bensUE/2BTjWYYiSugbMgkH4eG53pzXWXc38juwxOqWufDKFvI jUPHj/QlItoOpSLOTuYqyYTxAPVJfA+FIvIlsiL2ne3DMLkeFqQecnt+hf0vucX4uH 4tzNKx2tuHDFw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 86D72690B2 for ; Sat, 3 Jan 2026 13:33:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472427; bh=WfeuK6UJhN0Y1Igu/5Sx9dTGuXHKhTGAybcHszhL0Qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a2ivZGTDL2LKJ1sUommgHYrJ+YiqsJydfnQwP6lHe5OHCeB+yRzV+ACNm65ErMLEM nboHr1r/0NKxX+VOy4rSBGDBMytDNSNSEoKsBFPWZkMlVELGspCnTab819dcOmBa8E moX6mwuH9EOpV3QUjoF0PNMLaiP0DEsmvBwnhdANKySG90LB1DoIgNJxaxIYXKCftz od+B/7XsO3MXe+L9ne+GA1YGuu3WHz2DFkHls3eMdGm1vUhHmTUk8M0i8gRxoZ5kEr +rk3DcEM2CLWYNjqNa1nJ5SlXr4jMmnKVclk35AnxGeMYXqScAIefbuGkki8Pm/GBg a1vH0k9asfxqg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 12C9568F35; Sat, 3 Jan 2026 13:33:47 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id jYGUb97UsKui; Sat, 3 Jan 2026 13:33:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472422; bh=ngWVMViFptHAof3yqJb0YkczvR1Y155Rghn7NNRCJQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tg1Cu1W2CFqd9hWS1S3By5xhXD+ftrqbpEHjHVfj+K78rL4Ar1pVjIMcy+OubrjlT DRrX3ZYX14EwpijUwO5O1SdRMqK8+ypBGgPk5LlaGQ8OmFUTMdzhskAwjHNuNxHh3d ibs3M0fW2ktKfhuvfxmApx/HM/ptdRKuwxSiTjCHh041a5Qpqula/V0tNLaJXchsOs gtgoX6Oo61j4GACjVmEn37CRoAtlcfuN+3GAvDKuAlS/Yx1xOjiSza3WQrVtSNRf8F i1h9M9yApVLgvVFTpdfTZqgcE0/G/y3VOwLHXlQKRQoIklRA3eZAWimS1VuRnT50gv L4NZsQqG7CuAw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9AF7968FC8; Sat, 3 Jan 2026 13:33:42 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:37 -0700 Message-ID: <20260103203243.3727493-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ORR4DVGGB3A2WLEP7XLJOSLELXKUU6L3 X-Message-ID-Hash: ORR4DVGGB3A2WLEP7XLJOSLELXKUU6L3 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/12] buildman: Extract _check_board() from select_boards() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the board checking logic into a separate static method to reduce complexity of select_boards() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 91 +++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 0aea4bc826c..550c0feffa1 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -687,6 +687,53 @@ class Boards: terms.append(term) return terms + @staticmethod + def _check_board(brd, terms, brds, found, exclude_list, result): + """Check whether to include or exclude a board + + Checks the various terms and decides whether to build it or not. + + If it is built, add the board to the result[term] list so we know + which term caused it to be built. Add it to result['all'] also. + + Keep a list of boards we found in 'found', so we can report boards + which appear in self._boards but not in brds. + + Args: + brd (Board): Board to check + terms (list of Term): Terms to match against + brds (list of str): List of board names to build, or None + found (list of str): List to append found board names to + exclude_list (list of Expr): Expressions for boards to exclude + result (OrderedDict): Dict to store results in + """ + matching_term = None + build_it = False + if terms: + for term in terms: + if term.matches(brd.props): + matching_term = str(term) + build_it = True + break + elif brds: + if brd.target in brds: + build_it = True + found.append(brd.target) + else: + build_it = True + + # Check that it is not specifically excluded + for expr in exclude_list: + if expr.matches(brd.props): + build_it = False + break + + if build_it: + brd.build_it = True + if matching_term: + result[matching_term].append(brd.target) + result['all'].append(brd.target) + def select_boards(self, args, exclude=None, brds=None): """Mark boards selected based on args @@ -710,48 +757,6 @@ class Boards: argument list of str: Errors/warnings found """ - def _check_board(brd): - """Check whether to include or exclude a board - - Checks the various terms and decide whether to build it or not (the - 'build_it' variable). - - If it is built, add the board to the result[term] list so we know - which term caused it to be built. Add it to result['all'] also. - - Keep a list of boards we found in 'found', so we can report boards - which appear in self._boards but not in brds. - - Args: - brd (Board): Board to check - """ - matching_term = None - build_it = False - if terms: - for term in terms: - if term.matches(brd.props): - matching_term = str(term) - build_it = True - break - elif brds: - if brd.target in brds: - build_it = True - found.append(brd.target) - else: - build_it = True - - # Check that it is not specifically excluded - for expr in exclude_list: - if expr.matches(brd.props): - build_it = False - break - - if build_it: - brd.build_it = True - if matching_term: - result[matching_term].append(brd.target) - result['all'].append(brd.target) - result = OrderedDict() warnings = [] terms = self._build_terms(args) @@ -767,7 +772,7 @@ class Boards: found = [] for brd in self._boards: - _check_board(brd) + self._check_board(brd, terms, brds, found, exclude_list, result) if brds: remaining = set(brds) - set(found) From patchwork Sat Jan 3 20:32:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1259 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472433; bh=LSEyBP5JwlvJEx2xcDr295TjJONVCQ+LtKrar8In/KM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qYj9pHgJFX4oKdsCjwn4fbCkY6Gk9W6jWCIDtKsRSHXsb1rhectw1xoTGIhhY1VfI /9KA2nuvq9ANmo8qgOwhmA9ArFzsNulKjcqjU7APrG4UhAismSaREni4ZQ3cdzXc13 +iMnvcpmH9pmeUUS7WOx/BFGDkNprwatd8yBB7elwcwxaceVrMtPD7gkAaQ8ZQFORN 7fIl0o+o86obCSTP52sLSdAXFuG6amDGqYznhk9zPlAxXhuyI3Z4cjbUmWrWXQxOyQ IkL2eBeAQKlpBxYNBKZaj0Mimy4UGGtNlgxkkfC/E2xbcBsxUk0oHVzwUEQh0H+I6k Hl4yTMYO1WvVA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3C81C68F35 for ; Sat, 3 Jan 2026 13:33:53 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Ckpum6176o52 for ; Sat, 3 Jan 2026 13:33:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472433; bh=LSEyBP5JwlvJEx2xcDr295TjJONVCQ+LtKrar8In/KM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qYj9pHgJFX4oKdsCjwn4fbCkY6Gk9W6jWCIDtKsRSHXsb1rhectw1xoTGIhhY1VfI /9KA2nuvq9ANmo8qgOwhmA9ArFzsNulKjcqjU7APrG4UhAismSaREni4ZQ3cdzXc13 +iMnvcpmH9pmeUUS7WOx/BFGDkNprwatd8yBB7elwcwxaceVrMtPD7gkAaQ8ZQFORN 7fIl0o+o86obCSTP52sLSdAXFuG6amDGqYznhk9zPlAxXhuyI3Z4cjbUmWrWXQxOyQ IkL2eBeAQKlpBxYNBKZaj0Mimy4UGGtNlgxkkfC/E2xbcBsxUk0oHVzwUEQh0H+I6k Hl4yTMYO1WvVA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 21ABC68FC8 for ; Sat, 3 Jan 2026 13:33:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472431; bh=Hjhrk1UrjNT0F7LRnsok4KqnWYGfQ4AT9schVRWL1os=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GcvnYr0k+z9uaV9O1MO4PoI/eQKeyJT9O39aQcfq5R/7HH+Pt5z+7GGvJq7TAM4da mamSkRhuRS+cK+D9yW5tYNI1WyeLLsyYoTvj662GLGRkJeXejBM0CQF8zR7oIb6S1G 7dd+Ti800avguLzF9v8mjTJu8WqnvlntY6v0E8tS5UOFQ26lfnqAK9FGdnDzYmZpJT Sdi1T9R0hn5TPpUmwfcIcYa4CZiDHN6PewdUQ4cZsfJToKA3XjFNI2kQ2JgUUCjSSN sVZhdiJE4ggFVEkoqCwpUPLDO0f1NqFGk+XiILk1VGLXjQCNN1GYEukksm1tznoplF VBR4qapyVFjtw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C427368F35; Sat, 3 Jan 2026 13:33:51 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id EkVmiOfigO3o; Sat, 3 Jan 2026 13:33:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472427; bh=dcG/NftvcTGTNH8NyvQUffY8KLn1IFdV6V7jGxOn3PU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AvsvwQQiBlrElztcyi3pE+shQC30t6ksZAR64JA4syoANNHSbro1/cf2Roa3vMg5L IUMT64TRsT3s10s/niY1g9WrH3SqrpfHhng2AyokVoknMmu7VB2y86tmNZmhTdHhLp 3PRG8FiXrQGCOysp2hZS4AX8dBCzsy+h8x+aF20PPzbjQ/xrRbz8VSi6Szt/Cgwx5f cfeeNgErcMGomW748ozrWaTF8V7blf7aI0bJO+0+nwLZWnM3XuqrukZU+PlWkXkICT 0UUoCF6s5jxbQEpn4TnQnWNSVxA21BZT0rpjLDQFfo9JWDZiGGZQYEubkZUf4GRrH9 qRj73qgWGdxng== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 551AF68FC8; Sat, 3 Jan 2026 13:33:47 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:38 -0700 Message-ID: <20260103203243.3727493-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7SHUARK43WIYVEDUESIFB4HBT3VPNZMS X-Message-ID-Hash: 7SHUARK43WIYVEDUESIFB4HBT3VPNZMS X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/12] buildman: Fix remaining pylint warnings in boards.py List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass - Add module-level disable for too-many-lines - Suppress consider-using-with for NamedTemporaryFile (intentional) - Change unused linenum to _ in parse_file() - Suppress too-many-arguments for _check_board() - Add missing param documentation for parse_extended() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 550c0feffa1..7992aae0914 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -3,6 +3,8 @@ # Author: Simon Glass # Author: Masahiro Yamada +# pylint: disable=too-many-lines + """Maintains a list of boards and allows them to be selected""" from collections import OrderedDict, namedtuple @@ -268,6 +270,7 @@ class KconfigScanner: '-x', 'assembler-with-cpp', defconfig] stdout = command.output(*cmd, capture_stderr=True) + # pylint: disable=consider-using-with temp = tempfile.NamedTemporaryFile(prefix='buildman-') tools.write_file(temp.name, stdout, False) fname = temp.name @@ -523,7 +526,7 @@ class MaintainersDatabase: maintainers = [] status = '-' with open(fname, encoding="utf-8") as inf: - for linenum, line in enumerate(inf): + for _, line in enumerate(inf): # Check also commented maintainers if line[:3] == '#M:': line = line[1:] @@ -688,6 +691,7 @@ class Boards: return terms @staticmethod + # pylint: disable=too-many-arguments def _check_board(brd, terms, brds, found, exclude_list, result): """Check whether to include or exclude a board @@ -1076,7 +1080,12 @@ class Boards: raise ValueError(f"Board '{target}' not found") def parse_extended(self, dbase, fname): - """Parse a single 'extended' file""" + """Parse a single 'extended' file + + Args: + dbase (tuple): Database of defconfigs from qconfig + fname (str): Path to the extended-board file to parse + """ result = ExtendedParser.parse_file(fname) for ext in result: ext_boards = self.scan_extended(dbase, ext)