From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MFopLrkD22Cp6wAAgWs5BA (envelope-from ) for ; Tue, 29 Jun 2021 13:27:53 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id wFf/KbkD22D0bwAAB5/wlQ (envelope-from ) for ; Tue, 29 Jun 2021 11:27:53 +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 074EB28FD9 for ; Tue, 29 Jun 2021 13:27:53 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id ECBAC29103; Tue, 29 Jun 2021 07:27:48 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id CB014290A2 for ; Tue, 29 Jun 2021 07:27:44 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 777825FD21; Tue, 29 Jun 2021 07:27:44 -0400 (EDT) Received: (nullmailer pid 2138037 invoked by uid 1000); Tue, 29 Jun 2021 11:27:43 -0000 From: David Bremner To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH] devel: two scripts for checking proposed changes In-Reply-To: References: <20210628140810.1842069-1-david@tethera.net> Date: Tue, 29 Jun 2021 08:27:43 -0300 Message-ID: <874kdgc3m8.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 5RJDC6DJMH3XBZFU3NDG6N6CT73QAQDW X-Message-ID-Hash: 5RJDC6DJMH3XBZFU3NDG6N6CT73QAQDW X-MailFrom: david@tethera.net 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=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624966073; 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; bh=+45zlcC7QxTUs3MlpzVnqbaEEWybYthDdVwk5A63OJ0=; b=g/4Pt6EI1Kp35+li6OiZ64ZwADZ3CXZJQSi3kNnZoqWEUPok1UbHPT9U4a1JnpOzhiDMf0 wrTxUhjmNcSni6TylJ6Vt12YSyCPy07OW/tbALoN5SfSCNxEsTiRFXkRECBY76x52ArsOm AdJgqgMYY3MT6CMhQ0SIRk+VwF/CojSL40eof2Ngvn5Z49+pr8WQVA4TIth980O90hDH30 SSoaQLXjZe5V7Q26IsqARwkbwaCmuIiipl0BcAFNUU2lTyqPDdv2kkFjJMSyjvZOxPkvpg vN47s9lTVXeJ2l5LZnwgAZVsWfAVPbS0cYoYaqeTRX/hIuNKgTk+uqcaEBJ3HQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624966073; a=rsa-sha256; cv=none; b=FiF71xliA7YXqFVGDxPgmWV66WI47r5Barwn2P57WDD8xReaId/lqOPTC5IT6ZA4v8sWKA VNg5LB4NOke67Scyadw4bbKzK9jzWM8Uki9jOZkesMU+KJUeuGDKsI8LCJWLGcKb08Nuym LNH8cbpBd9Qq/p4eLnzu2Ton3OFlF3P5JwbJoUHT8l/rGVJmqiCyIBMyrRgnx4wRd4Yj4H w2+DsckaOzIpa/RDfKUzDduWozUOgiOK9aeN48eXZBfBYYb55RBBof0ZQ/hPY66fQCkgQ9 bCT8TtRPN8Nkt+QNhbw/VVLcfV72oJT9wmRlXxHmD0sKJxRA9bL3STcVcjtz1g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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: -2.06 Authentication-Results: aspmx1.migadu.com; dkim=none; 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: 074EB28FD9 X-Spam-Score: -2.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: xGr65rilXqLE 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? >> + ;; >> + *.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