From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id DbOAJ1S4fGrdAyEAWB0awg (envelope-from ) for ; Wed, 12 Aug 2026 14:15:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1786558548; bh=So6d1O8uz1RbLho2brBdt6MtZtq4DZum5GJZHYKm3x4=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=u75L79vvP0v+/1QGNUgn5Y2PyHfMo8031q9VnRsEQU9Tk3exHc1YqlHhiLGhAOvmi ld8RAD9g/6IB9MsGt5wHJQH5G7UliVodEs6Up3WOIIEOEAeyXLm/aXNNn95x0USVyH 1Fh7gXW7uYjublkuElNVM++NScFQ5ZC/B/QGGp6A= Received: by simark.ca (Postfix, from userid 112) id 8B5A81E166; Wed, 12 Aug 2026 14:15:48 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=h77YXyKi; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BBF201E09B for ; Wed, 12 Aug 2026 14:15:47 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3B8CA4BB3B85 for ; Wed, 12 Aug 2026 18:15:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B8CA4BB3B85 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=h77YXyKi Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 8C96B4BAE7FD for ; Wed, 12 Aug 2026 18:15:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C96B4BAE7FD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8C96B4BAE7FD Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786558524; cv=none; b=G8qJ1mjp2Y5QP1B5TgFfUS499yYqCs/JlKpMUwn8H8Xy5hb5TCaglAqyqIKVJ+AL41LovnHxiPdlr3BCrok5GLOES1/cMoJZfvr6fY8pABvEad1uCMyQCV36f3jULbFybaCrQ0PsJBELWmzOnojV6JVO3MKFlN/PnU/nvg+BWIs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786558524; c=relaxed/simple; bh=So6d1O8uz1RbLho2brBdt6MtZtq4DZum5GJZHYKm3x4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=rF/Ol6qK93yrY7MbpiQarphPWMxX5+ZQuVHORFQmnyMNKJQyqocivXE+GFav0lopefZcbOEv9gyoZT+Gz2J/GtZKshavTN0b/rw5wiAhtFNWS1Rg5jkJdsGL69eTqZ+wbLRJXuGZWB1iLEp2ehwI3c2KJRzTlwhWlGAVtJs1pqM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=h77YXyKi DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C96B4BAE7FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1786558523; bh=So6d1O8uz1RbLho2brBdt6MtZtq4DZum5GJZHYKm3x4=; h=Date:Subject:To:References:From:In-Reply-To:From; b=h77YXyKigzxNNvpyGT2QAbDUzS0D0lxq+AP6uLUSvDfllZf/Wc/syAe+2EfgWadDa UtkBCdptoCngsdquQokWEHwzyxIBGQQ+s2AdOJQxEVNDIDQ4aefyeJ8ICOz8G+Xr1E hlXTn3LkYPFHWM/NLo5DfjYrxYRvcpyCu95l1nqE= Received: by simark.ca (Postfix) id F3F3C1E09B; Wed, 12 Aug 2026 14:15:22 -0400 (EDT) Message-ID: Date: Wed, 12 Aug 2026 14:15:22 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/5] [pre-commit] Run flake8 for gdb/gdb-gdb.py.in To: Tom de Vries , gdb-patches@sourceware.org References: <20260720125056.1373177-1-tdevries@suse.de> <20260720125056.1373177-4-tdevries@suse.de> Content-Language: fr From: Simon Marchi In-Reply-To: <20260720125056.1373177-4-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 7/20/26 8:50 AM, Tom de Vries wrote: > When running the pre-commit hooks for gdb/gdb-gdb.py.in: > ... > $ pre-commit run --files gdb/gdb-gdb.py.in > black...................................................................Passed > flake8..............................................(no files to check)Skipped > isort...................................................................Passed > codespell...............................................................Passed > tclint..............................................(no files to check)Skipped > check-include-guards................................(no files to check)Skipped > check-gnu-style.....................................(no files to check)Skipped > - hook id: check-gnu-style > check-whitespace........................................................Passed > pre-commit-setup........................................................Passed > check-file-mode.........................................................Passed > ... > we see that flake8 is skipped. > > The hook setup has a types_or workaround that's supposed to prevent this: > ... > - id: flake8 > types_or: *gdb_python_types > files: *gdb_python_files > args: [--config, gdb/setup.cfg] > ... > but that doesn't work because flake8's .pre-commit-hooks.yaml doesn't set > types_or, but types: > ... > types: [python] > ... > > So we end up with an effective setting of both types and types_or: > ... > types: [python] > types_or: [file] > ... > which both have to be matched, and because gdb/gdb-gdb.py.in doesn't match > python: > ... > $ identify-cli gdb/gdb-gdb.py.in > ["file", "non-executable", "text"] > ... > the file is skipped. > > This could be fixed by: > ... > - types_or: [file] > + types: [file] > ... > but an isort update setting types_or could reintroduce the same problem. > > For robustness, fix this by setting both types and types_or for each python > hook. > > Using the same value for both settings would work: > ... > types: [file] > types_or: [file] > ... > because types and types_or have the same effect for list lengths 0 and 1. > > But I think it's better to have different anchors to avoid any confusion about > the and/or behavior, in which case it's more natural to use the actual default > [] for types_or, and to update the anchor names to reflect that these are the > default values: > ... > types: &types_default [file] > types_or: &types_or_default [] > ... Are we doing all this just for gdb-gdb.py.in? Because it might not need to be a ".in" file, I don't see any substitution in it (unlike gdb-gdb.gdb.in). Could we rename it to gdb-gdb.py and use AC_CONFIG_LINKS on it? Would that simplify things? Simon