From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uasIFgYaXmpOkRoAWB0awg (envelope-from ) for ; Mon, 20 Jul 2026 08:52:22 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TCLmVeQ4; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=a9GC6UQF; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TCLmVeQ4; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=a9GC6UQF; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 561511E099; Mon, 20 Jul 2026 08:52:22 -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 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 B153D1E099 for ; Mon, 20 Jul 2026 08:52:21 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6B7864BA7998 for ; Mon, 20 Jul 2026 12:52:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B7864BA7998 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TCLmVeQ4; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=a9GC6UQF; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TCLmVeQ4; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=a9GC6UQF Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id DFAAE4BA79A2 for ; Mon, 20 Jul 2026 12:50:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DFAAE4BA79A2 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DFAAE4BA79A2 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784551858; cv=none; b=Rm3GHeSOGKnyDSQeydl7joyFYr39PRa8OJFFNNwbN7Rsz5HxNh/9uVyDFZEKKHD0mUUcWYi3tSNQjaSUVDyhQ9bTCcEVJrxGHt6CgW+Dh/cg21JWHoWFYJPxW71C8PuJnUmL7dQIO2/xj1ZaS/S7OjpxlcyHiwXELjVb+r8bMUU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784551858; c=relaxed/simple; bh=kWZBgxKn7UTDyW7Ngk4vxj9UKxuy3TX3zvjDf3bhp/Q=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=oqrxJpMX1vhZLpfD5Pqr+9jJ54clSpse7dXDXPrF9ciIV6IkwAklFAjO5udESuoPQiUIeuG/P6x+MwcsQcqqu5DYAHOGnoCr22+gxBzGvA+59bqnL79Di3+5OTH9xU8fNgQpkJxC81kOD+KuPsT7GWOWNSlclrnNhOIIYJkR4mA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TCLmVeQ4; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=a9GC6UQF; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TCLmVeQ4; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=a9GC6UQF DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFAAE4BA79A2 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0ABC13E14 for ; Mon, 20 Jul 2026 12:50:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1784551857; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UpKJ5LLkPM0YVoOv79OhOyYb4ShKgRPpQKST1EpE/5g=; b=TCLmVeQ4vbD03d/+4GIV1hf9TTtN2LDmAMqtzWvU1s/4XKt0HautiUkAvvFCwxLYWgjuoA FeTN88yci+i9FK0heHYA4bfQI8hmBnuF7BJ2TDwMbLtacfTddBKxlLMIIpLEUMh4DuylcA j648oZwhWdkIGWCfMydSF2LBMMkzUnQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1784551857; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UpKJ5LLkPM0YVoOv79OhOyYb4ShKgRPpQKST1EpE/5g=; b=a9GC6UQFm91VyuFcyGGQAnvPrq1seaYmWtT/ei3P847LSSnvPqu4M0JHnG4InSO74wE2XZ qd6lXoclRc+E/0AQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1784551857; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UpKJ5LLkPM0YVoOv79OhOyYb4ShKgRPpQKST1EpE/5g=; b=TCLmVeQ4vbD03d/+4GIV1hf9TTtN2LDmAMqtzWvU1s/4XKt0HautiUkAvvFCwxLYWgjuoA FeTN88yci+i9FK0heHYA4bfQI8hmBnuF7BJ2TDwMbLtacfTddBKxlLMIIpLEUMh4DuylcA j648oZwhWdkIGWCfMydSF2LBMMkzUnQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1784551857; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UpKJ5LLkPM0YVoOv79OhOyYb4ShKgRPpQKST1EpE/5g=; b=a9GC6UQFm91VyuFcyGGQAnvPrq1seaYmWtT/ei3P847LSSnvPqu4M0JHnG4InSO74wE2XZ qd6lXoclRc+E/0AQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E8DCC779AD for ; Mon, 20 Jul 2026 12:50:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id YKmgN7AZXmrHawAAD6G6ig (envelope-from ) for ; Mon, 20 Jul 2026 12:50:56 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 3/5] [pre-commit] Run flake8 for gdb/gdb-gdb.py.in Date: Mon, 20 Jul 2026 14:50:54 +0200 Message-ID: <20260720125056.1373177-4-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260720125056.1373177-1-tdevries@suse.de> References: <20260720125056.1373177-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_TLS_ALL(0.00)[] 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 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 [] ... --- .pre-commit-config.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 60164e446fc..b437593b228 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,26 +53,33 @@ repos: # - gdb/testsuite/*.py # # Because gdb/gdb-gdb.py.in is not classified as python, we use - # 'types_or: [file]' to override the default type for these hooks. + # 'types: [file] / types_or: []' to override the default settings for these + # hooks. + # + # To be robust we set both types and types_or for each hook. Typically a + # repo sets only one of these, but that may change with any update. # - repo: https://github.com/psf/black-pre-commit-mirror rev: 26.5.1 hooks: - id: black - types_or: &gdb_python_types [file] + types: &types_default [file] + types_or: &types_or_default [] files: &gdb_python_files '^gdb/.*\.py(\.in)?$' - repo: https://github.com/pycqa/flake8 rev: 7.3.0 hooks: - id: flake8 - types_or: *gdb_python_types + types: *types_default + types_or: *types_or_default files: *gdb_python_files args: [--config, gdb/setup.cfg] - repo: https://github.com/pycqa/isort rev: 9.0.0b1 hooks: - id: isort - types_or: *gdb_python_types + types: *types_default + types_or: *types_or_default files: *gdb_python_files # Isort's .pre-commit-hooks.yaml sets stages, overriding default_stages, # so this hook needs an explicit setting. -- 2.51.0