diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c603d1f5d25..7d6e39dc31b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,12 +98,8 @@ jobs: ./rustup-toolchain "" -c clippy - name: rustfmt run: ./miri fmt --check - - name: clippy (miri) - run: cargo clippy --all-targets -- -D warnings - #- name: Clippy (ui_test) - # run: cargo clippy --manifest-path ui_test/Cargo.toml --all-targets -- -D warnings - - name: clippy (cargo-miri) - run: cargo clippy --manifest-path cargo-miri/Cargo.toml --all-targets -- -D warnings + - name: clippy + run: ./miri clippy -- -D warnings - name: rustdoc run: RUSTDOCFLAGS="-Dwarnings" cargo doc --document-private-items diff --git a/miri b/miri index e89a9e380ff..4dd34e0ef6c 100755 --- a/miri +++ b/miri @@ -28,6 +28,9 @@ times and slower execution times. ./miri fmt : Format all sources and tests. are passed to `rustfmt`. +./miri clippy : +Format all sources and tests. are passed to `cargo clippy`. + ENVIRONMENT VARIABLES MIRI_SYSROOT: @@ -163,6 +166,11 @@ fmt) find "$MIRIDIR" -not \( -name target -prune \) -name '*.rs' \ | xargs rustfmt --edition=2021 --config-path "$MIRIDIR/rustfmt.toml" "$@" ;; +clippy) + cargo clippy $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/Cargo.toml --all-targets "$@" + #cargo clippy $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/ui_test/Cargo.toml --all-targets "$@" + cargo clippy $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/cargo-miri/Cargo.toml "$@" + ;; *) if [ -n "$COMMAND" ]; then echo "Unknown command: $COMMAND" diff --git a/rustup-toolchain b/rustup-toolchain index 34472c727f6..7b9a17145d0 100755 --- a/rustup-toolchain +++ b/rustup-toolchain @@ -42,7 +42,7 @@ fi # Install and setup new toolchain. rustup toolchain uninstall miri -rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt "$@" -- "$NEW_COMMIT" +rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy "$@" -- "$NEW_COMMIT" rustup override set miri # Cleanup.