From 8092561c180c24bbd6b48bff42472379d4ee17c4 Mon Sep 17 00:00:00 2001 From: Samuel Moelius <35515885+smoelius@users.noreply.github.com> Date: Fri, 19 Jan 2024 09:01:27 -0500 Subject: [PATCH] Run `rustfilt` in coverage.yml --- .github/workflows/coverage.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 52480bb65..ff0ec79e2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,8 +24,10 @@ jobs: - name: Install dylint-link run: cargo install --path ./dylint-link - - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov + - name: Install cargo-llvm-cov and rustfilt + run: | + cargo install cargo-llvm-cov + cargo install rustfilt - name: Free up space on Ubuntu run: | @@ -39,11 +41,13 @@ jobs: run: | for X in . driver utils/linting; do pushd "$X" - cargo llvm-cov --coverage-target-only --target x86_64-unknown-linux-gnu --workspace --exclude examples --failure-mode all --lcov --output-path coverage.lcov + TMP="$(mktemp)" + cargo llvm-cov --coverage-target-only --target x86_64-unknown-linux-gnu --workspace --exclude examples --failure-mode all --lcov --output-path "$TMP" # smoelius: Collapse crate disambiguators. See: # - https://github.com/rust-lang/rust/blob/5ad7a646a5df1c7e37fc4529f0f1000091ac902d/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs#L416-L417 # - https://github.com/rust-lang/rust/blob/5ad7a646a5df1c7e37fc4529f0f1000091ac902d/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs#L58-L64 - sed -i 's/Cs[^_]*_/Cs_/g' coverage.lcov + # sed -i 's/Cs[^_]*_/Cs_/g' coverage.lcov + rustfilt -i "$TMP" -o coverage.lcov popd done