style: use shfmt 3.2.4

master
Harald Hoyer 2021-03-15 13:49:05 +01:00 committed by Harald Hoyer
parent f3dcb60619
commit cc914eaa8b
2 changed files with 9 additions and 2 deletions

View File

@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v2

- name: Run the sh-checker
uses: luizm/action-sh-checker@v0.1.12
uses: luizm/action-sh-checker@v0.1.13
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHELLCHECK_OPTS: -e SC1004 # exclude some shellcheck warnings.

View File

@ -24,12 +24,19 @@ For convenience there is also a Makefile `indent-c` target `make indent-c`.
To reformat shell files use `shfmt`:

```console
$ shfmt_version=3.0.1
$ shfmt_version=3.2.4
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w -s .
```

or

```console
$ GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
$ $GOPATH/bin/shfmt -w -s .
```

or if `shfmt` is already in your `PATH`, use `make indent`.

Some IDEs already have support for shfmt.