From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cTQnEfclNWooOA8AWB0awg (envelope-from ) for ; Fri, 19 Jun 2026 07:20: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=IYK1Cm7O; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0/CIIILS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=IYK1Cm7O; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0/CIIILS; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 406AA1E098; Fri, 19 Jun 2026 07:20: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=-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=unavailable autolearn_force=no version=4.0.1 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 9DFF91E024 for ; Fri, 19 Jun 2026 07:20:22 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 62DB34B9DB6E for ; Fri, 19 Jun 2026 11:20:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62DB34B9DB6E 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=IYK1Cm7O; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0/CIIILS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=IYK1Cm7O; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0/CIIILS Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id EFC344BA799F for ; Fri, 19 Jun 2026 11:19:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EFC344BA799F 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 EFC344BA799F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781867995; cv=none; b=tKkKOG88nbYKPBRbWZnoDVkspSSrV1xXBL34XHRSf6c/h//bhTzuMMVaIIFvdRGvEQJ8/nIViVwL1UEqPqUtejP3U/mNEis35QS0hmti1J8hHNoML8h87UdsifSMO+hTbosuBVvR7h6pEc4XXEfe+iT1a+VV9vjxgetO9eodk7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781867995; c=relaxed/simple; bh=HcRk503HBBq9jcAWVL96WcaTbLFFmgCMuhaqqPRRr88=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=mw8VsSLPKyBvIHBNputcslnS79qecKgq17GolUAnsIFGRvQVgh0ZsZA18B8mZRa6leDonTNvHNlmhrTRw8EmdWS/29dsGSPDLZansuZQyhqUDRE4G/OBvPGHkpbMG/6JL8UL9K1/lZVGe7gPTZIxVH9Dh1FjWIynXtN2ClOrUuY= 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=IYK1Cm7O; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0/CIIILS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=IYK1Cm7O; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0/CIIILS DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFC344BA799F 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-out1.suse.de (Postfix) with ESMTPS id 03E826DA25; Fri, 19 Jun 2026 11:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1781867994; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0zTnhoE9jHkubUqwBg4J+6XY3NwqCfoHyJD7pDRpIhY=; b=IYK1Cm7OdktIvCCTg4WMDyQ8QGSose2RoT7sw5ovylI0WvKZ52vONBja+j+FZAUAuHvSx7 KF5dcM1b2T9LB5xPPs527zW7eR1O8oJ6Vr+suWEaZbTh369rhWPmvtD96INF9pzNwQWOWw ZTQwoJ01AIupiAiznVUNg1QcIkVk5WM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1781867994; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0zTnhoE9jHkubUqwBg4J+6XY3NwqCfoHyJD7pDRpIhY=; b=0/CIIILSi5ybDQaZC2uPf5/5ft/f9ghCOAOwXDu8NEuxcaHcVy1N8Uca1vWPoguuCKKwW6 kDf5y+FmUpnDdQBQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1781867994; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0zTnhoE9jHkubUqwBg4J+6XY3NwqCfoHyJD7pDRpIhY=; b=IYK1Cm7OdktIvCCTg4WMDyQ8QGSose2RoT7sw5ovylI0WvKZ52vONBja+j+FZAUAuHvSx7 KF5dcM1b2T9LB5xPPs527zW7eR1O8oJ6Vr+suWEaZbTh369rhWPmvtD96INF9pzNwQWOWw ZTQwoJ01AIupiAiznVUNg1QcIkVk5WM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1781867994; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0zTnhoE9jHkubUqwBg4J+6XY3NwqCfoHyJD7pDRpIhY=; b=0/CIIILSi5ybDQaZC2uPf5/5ft/f9ghCOAOwXDu8NEuxcaHcVy1N8Uca1vWPoguuCKKwW6 kDf5y+FmUpnDdQBQ== 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 E11CE779A8; Fri, 19 Jun 2026 11:19:53 +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 ILKQNdklNWo5YAAAD6G6ig (envelope-from ); Fri, 19 Jun 2026 11:19:53 +0000 Message-ID: Date: Fri, 19 Jun 2026 13:19:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [pre-commit] Add shellcheck To: Simon Marchi , gdb-patches@sourceware.org References: <20260618151957.76500-1-tdevries@suse.de> Content-Language: en-US From: Tom de Vries In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWO(0.00)[2]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[pypi.org:url, sourceware.org:url, imap1.dmz-prg2.suse.org:helo, suse.de:mid] 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 6/18/26 7:05 PM, Simon Marchi wrote: > > > On 2026-06-18 11:19, Tom de Vries wrote: >> I found a pure python implementation of shellcheck [1]. >> >> Use it to run shellcheck on scripts in the repo. >> >> Exclude any scripts that are not currently clean. >> >> Running it seems reasonably fast: >> ... >> $ pre-commit run shellcheck --all-files -v >> shellcheck...............................................................Passed >> - hook id: shellcheck >> - duration: 0.06s >> ... >> >> For information on other solutions, see this RFC [2]. >> >> [1] https://pypi.org/project/pureshellcheck/0.2.2/ >> [2] https://sourceware.org/pipermail/gdb-patches/2024-November/213400.html > > While I'm sympathetic to the use of pre-commit (I added the first > hooks), I'm starting to get a bit worried that we kind of blindly pull > hooks from random places without paying much attention. This is going > to get executed on the machines of many GDB devs, and probably some CI > too. > > I had this thought because this one has the "random project on github > vibes" (it appears to be a vibe coded project started a week ago). More > established projects (like black) are not immune to being compromised, > but they are easier to trust I guess. > > Assuming you gave a quick look at the code of this project and judge > that it's fine, Yeah, I did, that is, I cloned the github repository, checked it out at main/v0.2.2, and asked claude code to review it on safety aspects. > how can we ensure that whatever pre-commit pulls is what > you reviewed? The mechanism to get the tool proposed in this patch is via pip. The pypi index mentions the github repo as source, so I'm relying on that. > We use a git tag, but is that sufficient? Could a > (malicious or compromised) project publish a tag, and then replaced that > tag with something else later? I suppose it's possible. > An alternative could be to point to a specific commit hash. A more > radical alternative would be to vendor (put in our repo) the code of the > hooks we use. > Yeah, that is safer. It would mean though using github as the source. But the repo as is doesn't have pre-commit hooks. I worked around that before by using my own github account (see commit 7f6c7a5bb37 ("[pre-commit] Add tclint hook")). I'll submit a v2 shortly that uses this approach. FWIW, I'm open to any other solutions. Thanks, - Tom > I'd like to hear your thoughts on this. > > Simon