From ac11530a84c49faed7bef15f223658c2dcc66543 Mon Sep 17 00:00:00 2001 From: "Matt \"Siyuan\" Yan" Date: Fri, 27 Feb 2026 17:46:21 +0900 Subject: [PATCH 1/2] ci: replace hand-maintained feature-soundness scripts with cargo-hack --- .github/workflows/clippy.yml | 18 ++++++++++++++++-- Makefile.toml | 2 +- ci/feature-soundness-release.sh | 20 -------------------- ci/feature-soundness.sh | 20 -------------------- packages/yew/Makefile.toml | 15 +++++++++------ 5 files changed, 26 insertions(+), 49 deletions(-) delete mode 100755 ci/feature-soundness-release.sh delete mode 100755 ci/feature-soundness.sh diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index f9901ac0cdc..fbd60862177 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -34,17 +34,31 @@ jobs: toolchain: stable components: clippy + - uses: taiki-e/install-action@cargo-hack + - uses: Swatinem/rust-cache@v2 with: save-if: ${{ github.ref == 'refs/heads/master' }} - name: Lint feature soundness if: matrix.profile == 'dev' - run: bash ./ci/feature-soundness.sh + run: >- + cargo hack clippy + -p yew -p yew-agent -p yew-router + --feature-powerset --no-dev-deps + --exclude-features test,serde,not_browser_env + --keep-going + -- -D warnings - name: Lint feature soundness if: matrix.profile == 'release' - run: bash ./ci/feature-soundness-release.sh + run: >- + cargo hack clippy + -p yew -p yew-agent -p yew-router + --feature-powerset --no-dev-deps + --exclude-features test,serde,not_browser_env + --keep-going --release + -- -D warnings clippy: name: Clippy Workspace diff --git a/Makefile.toml b/Makefile.toml index b7132665198..fac26114650 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -10,7 +10,7 @@ # * doc-test # * website-test # -# packages/yew also contains `clippy-feature-soundness` to ensure everything is fine +# packages/yew also contains `clippy-feature-soundness` (requires cargo-hack) # Run `cargo make --list-all-steps` for more details. # ###################### diff --git a/ci/feature-soundness-release.sh b/ci/feature-soundness-release.sh deleted file mode 100755 index 19387aaeabb..00000000000 --- a/ci/feature-soundness-release.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -xe - -# You can extract the feature list with the following command: -# cargo hack -p yew -p yew-agent -p yew-router --feature-powerset --print-command-list clippy --release -- -D warnings - -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features default,hydration,ssr -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features csr -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features default -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features csr,default -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features hydration -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features default,hydration -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features ssr -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features csr,ssr -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features default,ssr -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features csr,default,ssr -- -D warnings -cargo clippy --release --manifest-path packages/yew/Cargo.toml --no-default-features --features hydration,ssr -- -D warnings -cargo clippy --release --manifest-path packages/yew-agent/Cargo.toml -- -D warnings -cargo clippy --release --manifest-path packages/yew-router/Cargo.toml -- -D warnings diff --git a/ci/feature-soundness.sh b/ci/feature-soundness.sh deleted file mode 100755 index e4067a531fe..00000000000 --- a/ci/feature-soundness.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -xe - -# You can extract the feature list with the following command: -# cargo hack -p yew -p yew-agent -p yew-router --feature-powerset --print-command-list clippy -- -D warnings - -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features default,hydration,ssr -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features csr -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features default -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features csr,default -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features hydration -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features default,hydration -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features ssr -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features csr,ssr -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features default,ssr -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features csr,default,ssr -- -D warnings -cargo clippy --manifest-path packages/yew/Cargo.toml --no-default-features --features hydration,ssr -- -D warnings -cargo clippy --manifest-path packages/yew-agent/Cargo.toml -- -D warnings -cargo clippy --manifest-path packages/yew-router/Cargo.toml -- -D warnings diff --git a/packages/yew/Makefile.toml b/packages/yew/Makefile.toml index 643c4b948e7..5d03caf3b7f 100644 --- a/packages/yew/Makefile.toml +++ b/packages/yew/Makefile.toml @@ -22,9 +22,12 @@ args = ["test", "--all-targets", "--all-features"] dependencies = ["native-test", "wasm-test"] [tasks.clippy-feature-soundness] -script = ''' -#!/usr/bin/env bash -set -ex -bash ../../ci/feature-soundness.sh -bash ../../ci/feature-soundness-release.sh -''' +command = "cargo" +args = [ + "hack", "clippy", + "-p", "yew", "-p", "yew-agent", "-p", "yew-router", + "--feature-powerset", "--no-dev-deps", + "--exclude-features", "test,serde,not_browser_env", + "--keep-going", + "--", "-D", "warnings", +] From fa72abde4b85914ee0e57ea1930f14459c164a8c Mon Sep 17 00:00:00 2001 From: Matt Yan Date: Tue, 3 Mar 2026 21:22:18 +0900 Subject: [PATCH 2/2] ci: use full feature powerset and fix install-action ordering --- .github/workflows/clippy.yml | 6 ++---- packages/yew/Makefile.toml | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index fbd60862177..62ef8c6fa46 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -34,19 +34,18 @@ jobs: toolchain: stable components: clippy - - uses: taiki-e/install-action@cargo-hack - - uses: Swatinem/rust-cache@v2 with: save-if: ${{ github.ref == 'refs/heads/master' }} + - uses: taiki-e/install-action@cargo-hack + - name: Lint feature soundness if: matrix.profile == 'dev' run: >- cargo hack clippy -p yew -p yew-agent -p yew-router --feature-powerset --no-dev-deps - --exclude-features test,serde,not_browser_env --keep-going -- -D warnings @@ -56,7 +55,6 @@ jobs: cargo hack clippy -p yew -p yew-agent -p yew-router --feature-powerset --no-dev-deps - --exclude-features test,serde,not_browser_env --keep-going --release -- -D warnings diff --git a/packages/yew/Makefile.toml b/packages/yew/Makefile.toml index 5d03caf3b7f..63fdf541f93 100644 --- a/packages/yew/Makefile.toml +++ b/packages/yew/Makefile.toml @@ -27,7 +27,6 @@ args = [ "hack", "clippy", "-p", "yew", "-p", "yew-agent", "-p", "yew-router", "--feature-powerset", "--no-dev-deps", - "--exclude-features", "test,serde,not_browser_env", "--keep-going", "--", "-D", "warnings", ]