From fd26da46b4e43795d1be79f1e5683e6b03c66eb9 Mon Sep 17 00:00:00 2001 From: Tyler Crawford Date: Tue, 20 Feb 2024 10:16:25 -0500 Subject: [PATCH 1/2] Bump default `shfmt` version to latest `3.7.0` -> `3.8.0` --- .github/workflows/ci.yml | 10 +++++++--- CHANGES.md | 1 + .../java/com/diffplug/spotless/shell/ShfmtStep.java | 2 +- plugin-gradle/CHANGES.md | 1 + plugin-gradle/README.md | 2 +- plugin-maven/CHANGES.md | 1 + plugin-maven/README.md | 2 +- 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d4cfb57e..5e015ed12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: - kind: shfmt jre: 11 os: ubuntu-latest - shfmt-version: 3.7.0 + shfmt-version: v3.8.0 runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -83,11 +83,15 @@ jobs: - name: test npm if: matrix.kind == 'npm' run: ./gradlew testNpm + - name: Setup go + if: matrix.kind == 'shfmt' + uses: actions/setup-go@v5 + with: + go-version: 'stable' - name: Install shfmt if: matrix.kind == 'shfmt' run: | - 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 - chmod +x /usr/local/bin/shfmt + go install mvdan.cc/sh/v3/cmd/shfmt@${{ matrix.shfmt-version }} - name: Test shfmt if: matrix.kind == 'shfmt' run: ./gradlew testShfmt diff --git a/CHANGES.md b/CHANGES.md index 1b21b5785..b5a6b23f4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * Respect `.editorconfig` settings for formatting shell via `shfmt` ([#2031](https://github.com/diffplug/spotless/pull/2031)) ### Changes * Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045)) +* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#TODO](https://github.com/diffplug/spotless/pull/TODO)) ### Removed * **BREAKING** Remove `JarState.getMavenCoordinate(String prefix)`. ([#1945](https://github.com/diffplug/spotless/pull/1945)) * **BREAKING** Replace `PipeStepPair` with `FenceStep`. ([#1954](https://github.com/diffplug/spotless/pull/1954)) diff --git a/lib/src/main/java/com/diffplug/spotless/shell/ShfmtStep.java b/lib/src/main/java/com/diffplug/spotless/shell/ShfmtStep.java index 46f833bd0..6fd83aac8 100644 --- a/lib/src/main/java/com/diffplug/spotless/shell/ShfmtStep.java +++ b/lib/src/main/java/com/diffplug/spotless/shell/ShfmtStep.java @@ -40,7 +40,7 @@ public static String name() { } public static String defaultVersion() { - return "3.7.0"; + return "3.8.0"; } private final String version; diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index a97304f59..2279b4935 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -7,6 +7,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990)) ### Changes * Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045)) +* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#TODO](https://github.com/diffplug/spotless/pull/TODO)) ### Added * Respect `.editorconfig` settings for formatting shell via `shfmt` ([#2031](https://github.com/diffplug/spotless/pull/2031)) diff --git a/plugin-gradle/README.md b/plugin-gradle/README.md index 2add91765..db7622945 100644 --- a/plugin-gradle/README.md +++ b/plugin-gradle/README.md @@ -1011,7 +1011,7 @@ When formatting shell scripts via `shfmt`, configure `shfmt` settings via `.edit Refer to the `shfmt` [man page](https://github.com/mvdan/sh/blob/master/cmd/shfmt/shfmt.1.scd) for `.editorconfig` settings. ```gradle -shfmt('3.7.0') // version is optional +shfmt('3.8.0') // version is optional // if shfmt is not on your path, you must specify its location manually shfmt().pathToExe('/opt/homebrew/bin/shfmt') diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index 95661d4eb..26f284864 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -7,6 +7,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990)) ### Changes * Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045)) +* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#TODO](https://github.com/diffplug/spotless/pull/TODO)) ### Added * Respect `.editorconfig` settings for formatting shell via `shfmt` ([#2031](https://github.com/diffplug/spotless/pull/2031)) diff --git a/plugin-maven/README.md b/plugin-maven/README.md index fbe4248b7..89dd9e66e 100644 --- a/plugin-maven/README.md +++ b/plugin-maven/README.md @@ -1045,7 +1045,7 @@ When formatting shell scripts via `shfmt`, configure `shfmt` settings via `.edit ```xml - 3.7.0 + 3.8.0 /opt/homebrew/bin/shfmt ``` From df8f951636d47c2b78cbc4b3a14d43722ad97983 Mon Sep 17 00:00:00 2001 From: Tyler Crawford Date: Tue, 20 Feb 2024 11:31:19 -0500 Subject: [PATCH 2/2] Add pull request number --- CHANGES.md | 2 +- plugin-gradle/CHANGES.md | 2 +- plugin-maven/CHANGES.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b5a6b23f4..7e4a8c53a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,7 +15,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * Respect `.editorconfig` settings for formatting shell via `shfmt` ([#2031](https://github.com/diffplug/spotless/pull/2031)) ### Changes * Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045)) -* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#TODO](https://github.com/diffplug/spotless/pull/TODO)) +* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#2050](https://github.com/diffplug/spotless/pull/2050)) ### Removed * **BREAKING** Remove `JarState.getMavenCoordinate(String prefix)`. ([#1945](https://github.com/diffplug/spotless/pull/1945)) * **BREAKING** Replace `PipeStepPair` with `FenceStep`. ([#1954](https://github.com/diffplug/spotless/pull/1954)) diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index 2279b4935..20c78e880 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -7,7 +7,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990)) ### Changes * Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045)) -* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#TODO](https://github.com/diffplug/spotless/pull/TODO)) +* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#2050](https://github.com/diffplug/spotless/pull/2050)) ### Added * Respect `.editorconfig` settings for formatting shell via `shfmt` ([#2031](https://github.com/diffplug/spotless/pull/2031)) diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index 26f284864..1178b9360 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -7,7 +7,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990)) ### Changes * Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045)) -* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#TODO](https://github.com/diffplug/spotless/pull/TODO)) +* Bump default `shfmt` version to latest `3.7.0` -> `3.8.0`. ([#2050](https://github.com/diffplug/spotless/pull/2050)) ### Added * Respect `.editorconfig` settings for formatting shell via `shfmt` ([#2031](https://github.com/diffplug/spotless/pull/2031))