From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id XqeAMDPRx2jlMQUAWB0awg (envelope-from ) for ; Mon, 15 Sep 2025 04:41:23 -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=rT6WSOY3; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aoU4Z6WN; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=rT6WSOY3; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aoU4Z6WN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B5B3F1E0BA; Mon, 15 Sep 2025 04:41:23 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 53A181E047 for ; Mon, 15 Sep 2025 04:41:22 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 64B883858CD1 for ; Mon, 15 Sep 2025 08:41:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64B883858CD1 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=rT6WSOY3; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aoU4Z6WN; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=rT6WSOY3; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aoU4Z6WN Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 97CAE3858D1E for ; Mon, 15 Sep 2025 08:40:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 97CAE3858D1E 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 97CAE3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757925646; cv=none; b=M1rNxeSIqKccCEwaMCzczTYCSO/8AYniy5ns7/6L4wPwRvVFVpZaFrhREhiSJIBlME7mFi/qe5UR1iQHpBzr5FYlAlJMHykx/UJkcbKggzBE9nXKZEWyU1mAWb76yCEY8/5x27aNp2oQqRn5rjN9ge8jmf8uFxGq448HP0r1E0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757925646; c=relaxed/simple; bh=xOIhIf6MvT+0Ar2loVSs/4iuv/kXsgAg8UXgGaGrk8o=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=a2ZCtqAeGRSlSilxXSxwKWtup3g14cKAOBqLxaVRUF/qMePaj1sCzORfJSMqSKUnpIDn9KBrsuESZX9ziPrdtlrnEj/qpqab4e6LZRk4L5pZyWuPs8TgvRnN2Nk5EcYl+3HHLeSeYB7euCoaiS6r4j2JmsfnJ6LcbwuJxHaQk+Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97CAE3858D1E 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 6A9A81F821 for ; Mon, 15 Sep 2025 08:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757925645; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/8mfqgqQSHxxepW220IrKzpZolrtpp6Dit5NLx2dgO8=; b=rT6WSOY3tHZrKykbG+oEFALxtMddpP95SnaXmG5+rM6KAD0GucVsIN6er3W1i3G87hGWFo YepJA3wh6UOHJoYFls4y0KismzVqZruy6Ty4qqGsEMSqawptTznWycjTM4mMaa3lin2AUm RSU58IZ0CqwG0myJIkf7DOgxXJq1TAQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757925645; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/8mfqgqQSHxxepW220IrKzpZolrtpp6Dit5NLx2dgO8=; b=aoU4Z6WNSaJFe1u2XX7CNoZFcdbf+c6tb2atMFTQ9Ktqy0ihB5isyiKy+PYfEcjLEfnVye vl7K+MHX6nKfRnDw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757925645; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/8mfqgqQSHxxepW220IrKzpZolrtpp6Dit5NLx2dgO8=; b=rT6WSOY3tHZrKykbG+oEFALxtMddpP95SnaXmG5+rM6KAD0GucVsIN6er3W1i3G87hGWFo YepJA3wh6UOHJoYFls4y0KismzVqZruy6Ty4qqGsEMSqawptTznWycjTM4mMaa3lin2AUm RSU58IZ0CqwG0myJIkf7DOgxXJq1TAQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757925645; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/8mfqgqQSHxxepW220IrKzpZolrtpp6Dit5NLx2dgO8=; b=aoU4Z6WNSaJFe1u2XX7CNoZFcdbf+c6tb2atMFTQ9Ktqy0ihB5isyiKy+PYfEcjLEfnVye vl7K+MHX6nKfRnDw== 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 562F41368D for ; Mon, 15 Sep 2025 08:40:45 +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 1GPPEw3Rx2g/bAAAD6G6ig (envelope-from ) for ; Mon, 15 Sep 2025 08:40:45 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [pre-commit] Add tclint hook Date: Mon, 15 Sep 2025 10:41:05 +0200 Message-ID: <20250915084105.23171-1-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; 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)[suse.de:mid,imap1.dmz-prg2.suse.org:helo]; 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 Add a pre-commit hook that enables tclint [1] (a Tcl linter) for the gdb testsuite. The pre-commit hook doesn't reference the official url, because that one doesn't have pre-commit support yet [2]. Instead, it uses a fork on my personal github account. The fork contains a tag v0.6.0-gdb, which is the official v0.6.0 release plus a commit adding a .pre-commit-hooks.yaml file. Given that this is a personal github account, I thought it would be safer to refer to the git SHA than to the tag. Also add a tclint configuration file gdb/testsuite/tclint.toml. In the configuration file, we still ignore most dirs because they're not tclint-clean. Consequently, the tclint pre-commit check passes: ... $ pre-commit run --all-files -v tclint tclint........................Passed - hook id: tclint - duration: 0.25s $ ... PR testsuite/33403 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33403 [1] https://github.com/nmoroze/tclint [2] https://github.com/nmoroze/tclint/issues/110 --- .pre-commit-config.yaml | 15 ++++++++ gdb/testsuite/tclint.toml | 75 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 gdb/testsuite/tclint.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a4a8a5fa1ef..6bbd51fb6d0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -88,3 +88,18 @@ repos: verbose: true always_run: true stages: [commit-msg] + - # We'd like to use the official repo, like this: + # repo: https://github.com/nmoroze/tclint + # rev: v0.6.0 + # but it doesn't have a .pre-commit-hooks.yaml file. + # Work around this by using an unoffical repo. The repo contains a tag + # v0.6.0-gdb that adds a .pre-commit-hooks.yaml file to the v0.6.0 release + # of the offical repo. Since we're using an unofficial repo, use the git + # SHA instead of the tag. + repo: https://github.com/vries/tclint.git + rev: 2e6b4510fb3d3d6f8f2609af0f7158fabc0c96e4 + hooks: + - id: tclint + args: [--config, gdb/testsuite/tclint.toml] + types_or: [file] + files: 'gdb/testsuite/.*\.(exp|tcl)$' diff --git a/gdb/testsuite/tclint.toml b/gdb/testsuite/tclint.toml new file mode 100644 index 00000000000..c30fc210d63 --- /dev/null +++ b/gdb/testsuite/tclint.toml @@ -0,0 +1,75 @@ +# Copyright 2025 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Configuration file for tclint ( https://github.com/nmoroze/tclint ). + +exclude = [ +"gdb/testsuite/boards", +"gdb/testsuite/config", +"gdb/testsuite/lib", +"gdb/testsuite/gdb.ada", +"gdb/testsuite/gdb.arch", +"gdb/testsuite/gdb.asm", +"gdb/testsuite/gdb.base", +"gdb/testsuite/gdb.btrace", +"gdb/testsuite/gdb.compile", +"gdb/testsuite/gdb.cp", +"gdb/testsuite/gdb.ctf", +"gdb/testsuite/gdb.dap", +"gdb/testsuite/gdb.debuginfod", +"gdb/testsuite/gdb.disasm", +"gdb/testsuite/gdb.dlang", +"gdb/testsuite/gdb.dwarf2", +"gdb/testsuite/gdb.fortran", +"gdb/testsuite/gdb.gdb", +"gdb/testsuite/gdb.go", +"gdb/testsuite/gdb.guile", +"gdb/testsuite/gdb.linespec", +"gdb/testsuite/gdb.mi", +"gdb/testsuite/gdb.multi", +"gdb/testsuite/gdb.opencl", +"gdb/testsuite/gdb.perf", +"gdb/testsuite/gdb.python", +"gdb/testsuite/gdb.reverse", +"gdb/testsuite/gdb.rocm", +"gdb/testsuite/gdb.server", +"gdb/testsuite/gdb.stabs", +"gdb/testsuite/gdb.threads", +"gdb/testsuite/gdb.trace", +] + +# A maximum line length of 80 is current policy, but hasn't been too strictly +# enforced. It's the most frequent and least harmful violation. +# Ignore this for now. +ignore = ["line-length"] + +extensions = ["exp", "tcl"] + +[style] +# Used by tclfmt. Doesn't support mixed TAB and spaces style we use. See +# this tclint issue ( https://github.com/nmoroze/tclint/issues/109 ). +indent = 4 + +# Used by both tclint and tclfmt. Current policy is 80. +line-length = 80 + +# Used by tclfmt. +max-blank-lines = 1 + +# Used by tclfmt. False conflicts with emacs tcl mode. +indent-namespace-eval = true + +# Used by tclfmt. +spaces-in-braces = false base-commit: 6affec82bd4186aaf2e6733425b1e05870fc0582 -- 2.51.0