From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mF26ItrX2WChMQAAgWs5BA (envelope-from ) for ; Mon, 28 Jun 2021 16:08:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id mCZzHtrX2WDjbAAA1q6Kng (envelope-from ) for ; Mon, 28 Jun 2021 14:08:26 +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 8B66EC149 for ; Mon, 28 Jun 2021 16:08:21 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 7EBD12908D; Mon, 28 Jun 2021 10:08:17 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 614952908C for ; Mon, 28 Jun 2021 10:08:15 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id A39295FD21; Mon, 28 Jun 2021 10:08:14 -0400 (EDT) Received: (nullmailer pid 1842117 invoked by uid 1000); Mon, 28 Jun 2021 14:08:13 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH] devel: two scripts for checking proposed changes Date: Mon, 28 Jun 2021 11:08:10 -0300 Message-Id: <20210628140810.1842069-1-david@tethera.net> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Message-ID-Hash: 4R4G3W7PSFOZ57WLR2O7KJE6D4ZKPZQJ X-Message-ID-Hash: 4R4G3W7PSFOZ57WLR2O7KJE6D4ZKPZQJ X-MailFrom: bremner@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=1624889302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=EmoIwgwMyPM7ygnTx0h8QxuRvqxhqXnTYpUAziMkjww=; b=mTpIBQLTHtEZNnPzEbVqjJwbqFR2XKxXVxMEgalI0kRxx9VElQR1j/4pYz9iXAiKms+N9/ 9vftJRysQNK/Vi7PdP1YEqLpSPW9QlMnFG4VzFYlw07jcqMI4lBY8A5XjWo180c4PzWaGM Ix8OiVlSKTIx9euDntMX7XzAyNnA8VMqDvML12q+xxzUCuR+1SzWI1A/q77Gni47mVXoz5 qMFNZAXjkfUNwWWZWguol1FfmvE15J5SrgJXjjoezdXmwmJjjnU2lAgJAgDFfez+Ul067t CxlstJQnXaVig27ouXJHZdx1EOCbT+TZKhhFIZKypJl8QgwpkuGy9cjSyxEMYw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624889302; a=rsa-sha256; cv=none; b=PSyCX6sBAR6HIlaRuhZj5DzgAuB4n/2Ihd7zx8abGuVRgVP0k17+BA99CMtAH7vF2gMFiv h865Yfnm4R5LZHhUmplIbP5bq7FxNOycQvZdja05d2g3fT9UWLY/EuqEkOmu7xsbu0zOQj 5if9SntogJ8dfj+UQ0TPmuJl6AOUXxMgR2M7lKexLjfSzeSVXwVANM76eDyMrC8WqaPkxs DANLlarcSRWwuo5W1xmWPSaiBCoOJbOGgFEysK/u5fzIqEuFlT3E/I+E3kCrTFb1NJw0QS UAw2e8oysttB2i+IKyupf0SRtQNod4+6lCjL4NBqiHUc+qecdEzHyQhGx2HHIg== ARC-Authentication-Results: i=1; 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-Spam-Score: -1.07 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: 8B66EC149 X-Spam-Score: -1.07 X-Migadu-Scanner: scn1.migadu.com X-TUID: qr6Alhy3yiDA It took me a bit of effort to get the correct oneliner to reindent elisp from the command line, so I saved the results as 'reindent-elisp'. 'check-notmuch-commit' is an updated version of a script I have been using (although not always as consistently as I should) before sending patches to the list. Although it requires a bit more tooling, encouraging people to use check-notmuch-commit might reduce the number of round trips to the list for style nitpicks. --- devel/check-notmuch-commit | 20 ++++++++++++++++++++ devel/reindent-elisp | 8 ++++++++ 2 files changed, 28 insertions(+) create mode 100755 devel/check-notmuch-commit create mode 100755 devel/reindent-elisp diff --git a/devel/check-notmuch-commit b/devel/check-notmuch-commit new file mode 100755 index 00000000..98a19a64 --- /dev/null +++ b/devel/check-notmuch-commit @@ -0,0 +1,20 @@ +#!/bin/sh + +# Usage suggestion: +# git rebase -i --exec devel/check-notmuch-commit origin/master + +set -e +make test +for file in $(git diff --name-only HEAD^); do + case $file in + *.c|*.h|*.cc|*.hh) + uncrustify --replace -c $(dirname "$0")/uncrustify.cfg "$file" + ;; + *.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 + printf "usage: $0 \n" + exit 1 +fi + +emacs -Q --batch $1 --eval '(indent-region (point-min) (point-max) nil)' -f save-buffer -- 2.30.2