[Openvpn-devel] [PATCH v4] dev-tools/reformat-shell.sh: Make our shell code more consistent

Gert Doering <[email protected]>
Newsgroups net.sourceforge.lists.openvpn-devel
Message-ID <[email protected]>
From: Frank Lichtenheld <[email protected]>

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 <[email protected]>
Acked-by: Razvan Cojocaru <[email protected]>
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 <[email protected]>

        
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


_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.