From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wbRjNn6HMmrU1AsAWB0awg (envelope-from ) for ; Wed, 17 Jun 2026 07:39:42 -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=ZgkV9y71; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sjaFiZ2h; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ZgkV9y71; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sjaFiZ2h; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id DA84D1E098; Wed, 17 Jun 2026 07:39:42 -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 49FF31E024 for ; Wed, 17 Jun 2026 07:39:42 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4B92E4BB3B87 for ; Wed, 17 Jun 2026 11:39:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B92E4BB3B87 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=ZgkV9y71; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sjaFiZ2h; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ZgkV9y71; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sjaFiZ2h Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 344E44BB24FE for ; Wed, 17 Jun 2026 11:35:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 344E44BB24FE 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 344E44BB24FE 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=1781696124; cv=none; b=TxnKZWoF+XwAzgeOdpiKEUL+TTVlJBiBPcIWn+cQgbaNhfDgufqRp9zlmKGfWLSSkiwwUJMg9Mdb4tN/LPcwMKRzHjpXRPrxC7FXOciBTRiYoy13pVCLyagQyab2G+PpJ7lR5H5v5rmAo6XveB+Q2ucRIfDJIcn11m68QLVff9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781696124; c=relaxed/simple; bh=iy04TDbq0BAkypRN+arJRxR0m21Q1gCEwMKgCb+Gb1Q=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=AZa1H7cUI2R5Vzl02ZH8iIo4JKwof7BtVeT8LsfWCTPngBz8HJCw127ZB1ODqSXec4YJK9CiIA8HwRf9FQi0QjI5hpZGtSvmH0wRPrBmneLgjwf5gYUTkHIQ9nzndCTQegE8IqLfS0i7Vn1QBae5F/XoGLQLsq2iN9KJQzw9U+Q= 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=ZgkV9y71; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sjaFiZ2h; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ZgkV9y71; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sjaFiZ2h DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 344E44BB24FE Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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 9694475CBC for ; Wed, 17 Jun 2026 11:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1781696111; 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=MIp3pBRYaA/vVHRmShk8IG/pGcl+E9Ot7dxEfE2iHWA=; b=ZgkV9y711nASDlS20SCVb/oqKOQ3Fh/jKOwmguMaELXB05HyQuY+dmviWM10Rye7gW1M/o KoR7JhpaQFyxW+ICkV2yviSdg9IoJFJt45Tlxo6AOqhBrShbNxw2HYO3oGZvixGJrm3ghq dVwlu+DjAR9QAQQlwuHVP0yWI07eOWA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1781696111; 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=MIp3pBRYaA/vVHRmShk8IG/pGcl+E9Ot7dxEfE2iHWA=; b=sjaFiZ2hjA33dW2mlOULwTglHQbXT1vw/5Z4yqvtegxUwvzWo/DbybZrCNOnwBG1fgZhjp BN++k8YmNo5ro8CA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=ZgkV9y71; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=sjaFiZ2h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1781696111; 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=MIp3pBRYaA/vVHRmShk8IG/pGcl+E9Ot7dxEfE2iHWA=; b=ZgkV9y711nASDlS20SCVb/oqKOQ3Fh/jKOwmguMaELXB05HyQuY+dmviWM10Rye7gW1M/o KoR7JhpaQFyxW+ICkV2yviSdg9IoJFJt45Tlxo6AOqhBrShbNxw2HYO3oGZvixGJrm3ghq dVwlu+DjAR9QAQQlwuHVP0yWI07eOWA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1781696111; 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=MIp3pBRYaA/vVHRmShk8IG/pGcl+E9Ot7dxEfE2iHWA=; b=sjaFiZ2hjA33dW2mlOULwTglHQbXT1vw/5Z4yqvtegxUwvzWo/DbybZrCNOnwBG1fgZhjp BN++k8YmNo5ro8CA== 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 1F32A779B1 for ; Wed, 17 Jun 2026 11:35:11 +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 uBzuBW+GMmqNagAAD6G6ig (envelope-from ) for ; Wed, 17 Jun 2026 11:35:11 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 6/6] [pre-commit] Reorganize .pre-commit-config.yaml Date: Wed, 17 Jun 2026 13:35:09 +0200 Message-ID: <20260617113509.3510116-7-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260617113509.3510116-1-tdevries@suse.de> References: <20260617113509.3510116-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Action: no action X-Rspamd-Queue-Id: 9694475CBC X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.98%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid, suse.de:dkim, imap1.dmz-prg2.suse.org:rdns, imap1.dmz-prg2.suse.org:helo] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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 Reorganize .pre-commit-config.yaml: - unify indentation - move local hooks to last - add empty lines and header comments to make file more readable - move detailed file selection comment from flake8 settings to "Python hooks" since it's valid for all python hooks, and explain why the types_or setting is needed. - use anchors to avoid repetition --- .pre-commit-config.yaml | 62 ++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1d766189ca3..141451501ed 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,25 +40,29 @@ minimum_pre_commit_version: 4.5.1 default_install_hook_types: [pre-commit, commit-msg] default_stages: [pre-commit] + repos: + # Python hooks. Run these for (in glob notation): + # + # - gdb/gdb-gdb.py.in + # - gdb/*.py + # - gdb/python/**/*.py + # - 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. + # - repo: https://github.com/psf/black-pre-commit-mirror rev: 26.5.1 hooks: - - id: black - types_or: [file] - files: '^gdb/.*\.py(\.in)?$' + - id: black + types_or: [file] + files: '^gdb/.*\.py(\.in)?$' - repo: https://github.com/pycqa/flake8 rev: 7.3.0 hooks: - id: flake8 types_or: [file] - # Run this for (in glob notation): - # - # - gdb/gdb-gdb.py.in - # - gdb/*.py - # - gdb/python/**/*.py - # - gdb/testsuite/*.py - # files: '^gdb/.*\.py(\.in)?$' args: [--config, gdb/setup.cfg] - repo: https://github.com/pycqa/isort @@ -67,6 +71,8 @@ repos: - id: isort types_or: [file] files: '^gdb/.*\.py(\.in)?$' + + # Codespell hooks. - repo: https://github.com/codespell-project/codespell rev: v2.4.2 hooks: @@ -79,43 +85,47 @@ repos: args: [--toml, gdb/pyproject.toml] verbose: true stages: [commit-msg] + + # Tclint hooks. + - repo: https://github.com/nmoroze/tclint + rev: v0.8.0 + hooks: + - id: tclint + args: [--trust-plugins] + files: '^gdb/testsuite/.*\.(exp|tcl)$' + + # Local hooks. - repo: local hooks: - - id: check-include-guards - name: check-include-guards + - id: &id0 check-include-guards + name: *id0 language: unsupported_script entry: gdb/check-include-guards.py # All gdb header files, but not headers in the test suite. files: '^(gdb(support|server)?)/.*\.h$' exclude: '.*/testsuite/.*' - - id: check-gnu-style - name: check-gnu-style + - id: &id1 check-gnu-style + name: *id1 language: python additional_dependencies: ['termcolor', 'unidiff'] entry: gdb/contrib/check-gnu-style-pre-commit.sh files: '^(gdb(support|server)?)/.*\.(c|h|cc)$' exclude: '.*/testsuite/.*' verbose: true - - id: check-whitespace - name: check-whitespace + - id: &id2 check-whitespace + name: *id2 language: unsupported_script entry: gdb/contrib/check-whitespace-pre-commit.py files: '^(gdb(support|server)?)/.*$' - - id: pre-commit-setup - name: pre-commit-setup + - id: &id3 pre-commit-setup + name: *id3 language: python entry: gdb/contrib/pre-commit-setup.py additional_dependencies: ["pyyaml"] always_run: true pass_filenames: false - - id: check-file-mode - name: check-file-mode + - id: &id4 check-file-mode + name: *id4 language: unsupported_script entry: gdb/contrib/check-file-mode.sh files: '^(gdb|gdbserver|gdbsupport)/.*$' - - repo: https://github.com/nmoroze/tclint - rev: v0.8.0 - hooks: - - id: tclint - args: [--trust-plugins] - files: '^gdb/testsuite/.*\.(exp|tcl)$' -- 2.51.0