[Openvpn-devel,v4] dev-tools/reformat-shell.sh: Make our shell code more consistent
| Message ID | 20260820091512.4550-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:7000:4319:b0:87d:ab56:3700 with SMTP id
q25csp1568063mae;
Thu, 20 Aug 2026 02:15:55 -0700 (PDT)
X-Forwarded-Encrypted: i=2;
AHgh+RqtZEkRc2D95y8gWtnEVHP+XsoRd8MhQDyiu9NQJQ9Ch5O8lxUqVtC9yQPMsWs/VhZT9jxg+VQRSkE=@openvpn.net
X-Received: by 2002:a05:6830:83b4:b0:7e6:e1d2:3bd0 with SMTP id
46e09a7af769-7f43fa4ea4emr11486661a34.10.1787217354804;
Thu, 20 Aug 2026 02:15:54 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1787217354; cv=none;
d=google.com; s=arc-20260327;
b=W+INUsbYANTkHy549uI4Gk2ceWrJ4JSFha1n7qMw1RtP+4Oi+HvW17KT9VmtqUho5G
cESwpUWJADQaXFmmHMFU2G2xE65dEbdUGxiop1dWVfMlBjoIQuP80YaVAmPsLjQxXDM3
aEPfHzlIxSaigwVOeKPetzfdGwtS4vdVab0aq/BH1xh6f455HOcPxwTbdUPixCcrPAf1
GNTyAKuRSTU0OHlyU4c7a5wSignIep+gDxLHoF/l5rzjT6QOjqOHBG/rK6gQ860oWD4o
zO12w2omPzt0WSPtdWGyxOa+dAZOuiKbWDgt9tlYu1IyW+o1PVXdaJ+uC88a7ui1cp0H
FyEA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20260327;
h=errors-to:content-transfer-encoding:list-subscribe:list-help
:list-post:list-archive:list-unsubscribe:list-id:precedence:subject
:mime-version:references:in-reply-to:message-id:date:to:from
:dkim-signature:dkim-signature:dkim-signature;
bh=QHdn0JYuVIyHSE9Qe1k8yPRqAcRe3G0Usq6HR/AEGjY=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=V0I6yGz//tnl3fsylJwjPEXYY3O1fHSSmqbNnt66enLuO6sP/VxuazQT6gWZfUddGM
CGdhy8Tho2K9/80VaiD2KfEOl7IDk3fJuA+oFyPBsYA2ihYoPx5V9p/wK0TKX4rg2SHS
blbh29xjYeGZWVYWJMEjLka36A26hTb/ETBXYzuNZcU5ePPsYJoCF2Rc+j8eolop/2mq
Vv1GX6HEFXAwt84QLxz44ylBlbqw1pipRX+2azwGFlWPff56eAOb2misG9H1yb5avJ2O
rPG1FKISFB3cITdzLjIPeUeBLW5cOTis0deFRBSoeOs52Yc0fcldG/Orzgds3hLzovkX
NChg==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=eo2MPpz6;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=UPXTHj1o;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=QJrEQtZh;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net;
dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de
Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7])
by mx.google.com with ESMTPS id
46e09a7af769-7f44009646fsi9440607a34.115.2026.08.20.02.15.54
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Thu, 20 Aug 2026 02:15:54 -0700 (PDT)
Received-SPF: pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) client-ip=216.105.38.7;
Authentication-Results: mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=eo2MPpz6;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=UPXTHj1o;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=QJrEQtZh;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net;
dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:
List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:
Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender:
Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner;
bh=QHdn0JYuVIyHSE9Qe1k8yPRqAcRe3G0Usq6HR/AEGjY=; b=eo2MPpz6QF+diNdYINBwJgnjsJ
8Y2sYGuI6PsnEC4x/qPcUlX9kbaMdgQa9ChqpprQtapX2ZLxm5RwxkOiwa+/U0DmvvST94ovx79Zy
8DYEmzv4dSRKO9ffgXRs1PN1gCoiJLNE04xtIG7Pn5h70DPpHSXuOVQaeN8w+g3IoMwc=;
Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com)
by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1wwysJ-0003Qj-T3;
Thu, 20 Aug 2026 09:15:49 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95)
(envelope-from <gert@blue4.greenie.muc.de>) id 1wwys2-0003Pr-6z
for openvpn-devel@lists.sourceforge.net;
Thu, 20 Aug 2026 09:15:31 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References:
In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:
Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
List-Subscribe:List-Post:List-Owner:List-Archive;
bh=VWNvQDA0m5tLP/xez2CAqqbUW3ysXqcJExf5Z/kDL2w=; b=UPXTHj1oDyV6VVSsUdz5ohwbh1
SuvelGQVrZmaTRDwoNsmi9CIu64i20qXmseptU0qWuIBxrLvtCr444kjZIG9GAxK6OYvkKb/iRGuk
14l4Ly8ijqxUeoc3u7Y6c2XZAlGacA2nc/VL7V55aYnEjOeiwOM/d58lMlE1a1wvLal4=;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x
;
h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:
Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
List-Post:List-Owner:List-Archive;
bh=VWNvQDA0m5tLP/xez2CAqqbUW3ysXqcJExf5Z/kDL2w=; b=QJrEQtZhCM3gLRcCbWew6lH+6Q
ATaea1/UIlpmr9bckMCguwm2TI7SzRGJsV09BnYeguCeanhROoANVu0yzuXdnq7f4/tzZJpqIHQ8p
x84PXk9UZUXMtUakYSHGCT0Vcl6p24Utsg+OJZKzNG9807lRlq/4gF+oOZ51s8GMt+zo=;
Received: from [193.149.48.129] (helo=blue.greenie.muc.de)
by sfi-mx-1.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95)
id 1wwyro-0001CH-5s for openvpn-devel@lists.sourceforge.net;
Thu, 20 Aug 2026 09:15:22 +0000
Received: from blue.greenie.muc.de (localhost [127.0.0.1])
by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 67K9FDv1004564
for <openvpn-devel@lists.sourceforge.net>; Thu, 20 Aug 2026 11:15:13 +0200
Received: (from gert@localhost)
by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 67K9FDDM004563
for openvpn-devel@lists.sourceforge.net; Thu, 20 Aug 2026 11:15:13 +0200
From: Gert Doering <gert@greenie.muc.de>
To: openvpn-devel@lists.sourceforge.net
Date: Thu, 20 Aug 2026 11:15:07 +0200
Message-ID: <20260820091512.4550-1-gert@greenie.muc.de>
X-Mailer: git-send-email 2.53.0
In-Reply-To:
<gerrit.1784305303000.I80a94dde26631e5a665029f495b2104cfecb1915@gerrit.openvpn.net>
References:
<gerrit.1784305303000.I80a94dde26631e5a665029f495b2104cfecb1915@gerrit.openvpn.net>
MIME-Version: 1.0
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software,
running on the system "sfi-spamd-2.hosts.colo.sdot.me",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: From: Frank Lichtenheld <frank@lichtenheld.com> Our shell
code is currently not very consistent about formatting. So provide a tool
to achieve that consistency. Especially in our test code we have several
important shell scripts that we actively de [...]
Content analysis details: (1.3 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Headers-End: 1wwyro-0001CH-5s
Subject: [Openvpn-devel] [PATCH v4] dev-tools/reformat-shell.sh: Make our
shell code more consistent
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: 1874033225375773559
X-GMAIL-MSGID: 1874033225375773559
|
| Series |
[Openvpn-devel,v4] dev-tools/reformat-shell.sh: Make our shell code more consistent
|
|
Commit Message
Gert Doering
Aug. 20, 2026, 9:15 a.m. UTC
From: Frank Lichtenheld <frank@lichtenheld.com> Our shell code is currently not very consistent about formatting. So provide a tool to achieve that consistency. Especially in our test code we have several important shell scripts that we actively develop. Change-Id: I80a94dde26631e5a665029f495b2104cfecb1915 Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Razvan Cojocaru <razvanc@mailbox.org> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1792 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1792 This mail reflects revision 4 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru <razvanc@mailbox.org>
Comments
This doesn't add or change any code in the repo yet, but it provides the
tooling to keep our shell scripts in matching style later on - and having
it in the repo means "everyone can run it". As we usually do :-)
Nothing tested yet, but we discussed the desired output, and what comes
in the next patch "all makes sense".
Your patch has been applied to the master branch.
commit 5663fd71f4358e404031d57f9ec1acbb0b78358a
Author: Frank Lichtenheld
Date: Thu Aug 20 11:15:07 2026 +0200
dev-tools/reformat-shell.sh: Make our shell code more consistent
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Razvan Cojocaru <razvanc@mailbox.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1792
Message-Id: <20260820091512.4550-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg38546.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/dev-tools/reformat-shell.sh b/dev-tools/reformat-shell.sh new file mode 100755 index 0000000..dbbdaa9 --- /dev/null +++ b/dev-tools/reformat-shell.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# +# Apply consistent formatting to our shell code. +# Uses shfmt: https://github.com/mvdan/sh + +set -u + +FORMAT_ARGS="--indent=4 --func-next-line --case-indent" +FORMAT_CMD="shfmt --list --write" + +# hardcoded to --posix due to .in filename and invalid shebang +$FORMAT_CMD --posix $FORMAT_ARGS ./tests/t_client.sh.in +# handle *.sh files recursively +$FORMAT_CMD $FORMAT_ARGS ./tests ./dev-tools