From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id dqiHAP4i+2AVfAAAgWs5BA (envelope-from ) for ; Fri, 23 Jul 2021 22:13:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id MKUlN/0i+2CQFQAAB5/wlQ (envelope-from ) for ; Fri, 23 Jul 2021 20:13:49 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7E35811E55 for ; Fri, 23 Jul 2021 22:13:49 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 409FB2757D; Fri, 23 Jul 2021 16:13:45 -0400 (EDT) Received: from lahtoruutu.iki.fi (unknown [IPv6:2a0b:5c81:1c1::37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 4640726B40 for ; Fri, 23 Jul 2021 16:13:42 -0400 (EDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 7917F1B00213; Fri, 23 Jul 2021 23:13:29 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1627071209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WFBDVq/r5uF1h3gBrxWC8myV9u5mTUroY8eHycbsXK8=; b=pqe+y9h6mKOethXkedjfSCA5jzjXieWfV0Px/ajUQ2262Z0E6SmS58reOp112g6NK1D+nW BiJQk+oAjUQFAUANuM+cutyWLqtOxni6oDpzKA4uIM/uOd7ADdiwqMKvKmrslSuk3xba/9 uCEfogxbxHYZtJopwUnn6ciKSbI0/+Z3jEEjk+98y3sDSxYa/3fPYL8CpwbmRxb1T6dwHm Ad5r3EW8sR2dqLIKfJlFWGC4AhWmItWTC++H7Y1jGVjpWlosFx5Qzl+0IY8XawnkMY9N07 y4IR99WlAMUqnJvPF6qT1Kf/0pVAyKVMAClmvGzrkVhyUrTJ+RiuXu0UGY9Zqw== From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH] devel: two scripts for checking proposed changes In-Reply-To: <874kdgc3m8.fsf@tethera.net> References: <20210628140810.1842069-1-david@tethera.net> <874kdgc3m8.fsf@tethera.net> User-Agent: Notmuch/0.32+21~gfdddd4c (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1627071209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WFBDVq/r5uF1h3gBrxWC8myV9u5mTUroY8eHycbsXK8=; b=njWEdZiN1SCxTjcMGJn4tYLxo0S8DkROM4D22vh38h/kMddpC8geenvDxFBldxsJjvfVo+ u4g7W01pNSTqvFRzh+95zkhhsdzR2QITiawEUWYneAUCSwY4UswNgUA/lMod/JArpXe575 5w39QF0mH7fA2jfXMWC7yH6dQiihGh1N+bU8VYmBiky7cHM0tQ/GG8KhOaPyEO2XxYzCpm m7ZxbaSoeoZenRqBjFeRtJtIQCCHmmtx62ulPh94adZZpWft82TJ9mELgduF5HkDgY2avN pLljHKYjvmri4cVcM87iXubBhtAL+oHWvG9Ddet3tlDl8pdt7RTezvPTRMGlYQ== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1627071209; a=rsa-sha256; cv=none; b=miRj6JNh61N5fkGS31TYu1WLW/V9QKz5MnPP2an4sj33hz6+wA4BD4+a94V8aorEbdkuBr 5bZ5uR9wMBSdSTAcZZSZvybug4T0ZDxptFO2rxkWPweBgbeE/0CuCshA/zbZVpQah6qRLj MxFyDQg5fuP44hMfH0ra4D/+5YPLGmpsNumevg2ovsJqep/zzgdJReJOdbv4umn3nH9IFg G0FU4ZhjpNS92Y3GI82F2UDhcXPqhK66nWZdyAdcg83SLH5ilmFGWwhedmFezLX1PA4CE4 ptxY0E4JXhXvraRM2un+g3IwQFVrPnxrAP6i6m0a6IJ9c6SfcgIvE8JXSQJ3UA== Message-ID-Hash: 7I37WJG7UY4FY2H5P2YUNIFZPMKRPQJI X-Message-ID-Hash: 7I37WJG7UY4FY2H5P2YUNIFZPMKRPQJI X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627071229; h=from:from:reply-to:subject:subject: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=5ympd+4T2Zc1StPcWft+I8wM6Vpdj91fTGDRIb2DQdw=; b=eEm4xuRUvnxU/cNJsJinxosxvYBFLWkdqGYpqVb/Ra0SsYnbK07gxq96uZrxxIkJfLQLHt kq2rSDwWVGCNuMnZuRysVAlBqczPw+lI3+rCIygyKaOI4YOLtIFn3g0eA0saRVROlBl0WR Krmw30No+/JFhI6QjxLwYjN3jR8iyK2oegaQudmlUPRxKBqpzL+v9zmY1orMY/amypNbCV D9+jVaLckJAwQPsmppWLnjNklOLsQypTxwAaTxjgtl8pPKUTjociTKpi3qZX/O/mXyzUVT Uut18TEJNa0xCUMYCCimrzpS8MKx7p33AO4m5QEAn749Sj/vzaDBnziCNXb2Pg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1627071229; a=rsa-sha256; cv=fail; b=eKYI5+/+cOeec5759hVYeAYd0gzDYAcFcFKfNpevk6eglE9S30l31lJ4Ha7XKaP3jFeNxu ih3Cx7ZXh+AMaKq1T06PgXXyjGldVe1u2ojFz/Q9R82ESE2H8rGyhusm6iLeMHB/QaYxhF noHWHbWS69xRUORFSxrM4/o2RS9x9cxucuVhNZVJ3i3iOxAcbQ3UDvfvjPwCDXhzOJgryf tNUrpNd5DPOrdnN3jpv4hi2tCqZdjXityP96Zgp9RG3lcHrVvoLIlZihUaUGwStUsShQOV +qy3pPs27Ch2zbvOl79ejryJv4IXlVuMBWFN/K+UE14RKRnPYQ7uYRhiP0bcAw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=pqe+y9h6; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 0.96 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=pqe+y9h6; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 7E35811E55 X-Spam-Score: 0.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: mW3aR9y6KdeO On Tue, Jun 29 2021, David Bremner wrote: > Tomi Ollila writes: > >>> + >>> +set -e >>> +make test >> >> This may fail miserably (or is painfully slow (doing configure and make...) >> > > At least for my use case, running the tests for each commit is the main > point. The formatting stuff is nice to have, but only if the tests run. > I could invoke the notmuch-test script directly, but that is > arguably slightly less robust because of the need to create test-binaries. > >>> +for file in $(git diff --name-only HEAD^); do >> >> is this also mentioning deleted files... ? (--diff-filter=AM) ? > > Oh, good point. > >> >>> + case $file in >>> + *.c|*.h|*.cc|*.hh) >>> + uncrustify --replace -c $(dirname "$0")/uncrustify.cfg "$file" >> >> dirname "$0" could be resolved once before loop. >> > > yes, although I'm not sure it's a win? actually (IMO) the 'winnest' option is to: first have unset dn0 and then in all cases of $(dirname "$0") to be replaced with "${dn0=$(dirname "$0")}" In this case $(dirname "$0") is executed at most once -- but zero times in case the result is never used. (note also quotes around the whole expression :) Tomi > >>> + ;; >>> + *.el) >>> + $(dirname "$0")/reindent-elisp "$file" >>> + ;; >>> + esac >>> +done >>> + >>> +git diff --quiet >>> + >>> diff --git a/devel/reindent-elisp b/devel/reindent-elisp >>> new file mode 100755 >>> index 00000000..f6ce3844 >>> --- /dev/null >>> +++ b/devel/reindent-elisp >>> @@ -0,0 +1,8 @@ >>> +#!/bin/sh >>> + >>> +if [ $# -lt 1 ]; then >> >> if [ $# -ne 1 ] ... (see at the end) >> > OK >>> + printf "usage: $0 \n" >> >> Angle brackets are bad in example -- if copy-pasted to terminal (and badly >> edited) does redirections... > > ack > >> >>> + exit 1 >>> +fi >>> + >>> +emacs -Q --batch $1 --eval '(indent-region (point-min) (point-max) nil)' >>> -f save-buffer >> >> ... as here is $1 -- which should be quoted as "$1" > > OK > >> >>> -- >>> 2.30.2 > _______________________________________________ > notmuch mailing list -- notmuch@notmuchmail.org > To unsubscribe send an email to notmuch-leave@notmuchmail.org