Skip to content

Commit aceab65

Browse files
authored
Bump default shfmt version to latest 3.7.0 -> 3.8.0 (#2050)
2 parents 63ff3b3 + df8f951 commit aceab65

File tree

7 files changed

+13
-6
lines changed

7 files changed

+13
-6
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- kind: shfmt
6161
jre: 11
6262
os: ubuntu-latest
63-
shfmt-version: 3.7.0
63+
shfmt-version: v3.8.0
6464
runs-on: ${{ matrix.os }}
6565
steps:
6666
- name: Checkout
@@ -83,11 +83,15 @@ jobs:
8383
- name: test npm
8484
if: matrix.kind == 'npm'
8585
run: ./gradlew testNpm
86+
- name: Setup go
87+
if: matrix.kind == 'shfmt'
88+
uses: actions/setup-go@v5
89+
with:
90+
go-version: 'stable'
8691
- name: Install shfmt
8792
if: matrix.kind == 'shfmt'
8893
run: |
89-
curl -sSfL "https://github.com/mvdan/sh/releases/download/v${{ matrix.shfmt-version }}/shfmt_v${{ matrix.shfmt-version }}_linux_amd64" -o /usr/local/bin/shfmt
90-
chmod +x /usr/local/bin/shfmt
94+
go install mvdan.cc/sh/v3/cmd/shfmt@${{ matrix.shfmt-version }}
9195
- name: Test shfmt
9296
if: matrix.kind == 'shfmt'
9397
run: ./gradlew testShfmt

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1515
* Respect `.editorconfig` settings for formatting shell via `shfmt` ([#2031](https://github.com/diffplug/spotless/pull/2031))
1616
### Changes
1717
* Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045))
18+
* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#2050](https://github.com/diffplug/spotless/pull/2050))
1819
### Removed
1920
* **BREAKING** Remove `JarState.getMavenCoordinate(String prefix)`. ([#1945](https://github.com/diffplug/spotless/pull/1945))
2021
* **BREAKING** Replace `PipeStepPair` with `FenceStep`. ([#1954](https://github.com/diffplug/spotless/pull/1954))

lib/src/main/java/com/diffplug/spotless/shell/ShfmtStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static String name() {
4040
}
4141

4242
public static String defaultVersion() {
43-
return "3.7.0";
43+
return "3.8.0";
4444
}
4545

4646
private final String version;

plugin-gradle/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
77
* Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990))
88
### Changes
99
* Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045))
10+
* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#2050](https://github.com/diffplug/spotless/pull/2050))
1011
### Added
1112
* Respect `.editorconfig` settings for formatting shell via `shfmt` ([#2031](https://github.com/diffplug/spotless/pull/2031))
1213

plugin-gradle/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ When formatting shell scripts via `shfmt`, configure `shfmt` settings via `.edit
10111011
Refer to the `shfmt` [man page](https://github.com/mvdan/sh/blob/master/cmd/shfmt/shfmt.1.scd) for `.editorconfig` settings.
10121012
10131013
```gradle
1014-
shfmt('3.7.0') // version is optional
1014+
shfmt('3.8.0') // version is optional
10151015
10161016
// if shfmt is not on your path, you must specify its location manually
10171017
shfmt().pathToExe('/opt/homebrew/bin/shfmt')

plugin-maven/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
77
* Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990))
88
### Changes
99
* Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045))
10+
* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#2050](https://github.com/diffplug/spotless/pull/2050))
1011
### Added
1112
* Respect `.editorconfig` settings for formatting shell via `shfmt` ([#2031](https://github.com/diffplug/spotless/pull/2031))
1213

plugin-maven/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ When formatting shell scripts via `shfmt`, configure `shfmt` settings via `.edit
10451045

10461046
```xml
10471047
<shfmt>
1048-
<version>3.7.0</version> <!-- optional: Custom version of 'mvdan/sh' -->
1048+
<version>3.8.0</version> <!-- optional: Custom version of 'mvdan/sh' -->
10491049
<pathToExe>/opt/homebrew/bin/shfmt</pathToExe> <!-- optional: if shfmt is not on your path, you must specify its location manually -->
10501050
</shfmt>
10511051
```

0 commit comments

Comments
 (0)