From cac53c24ec9b1af35d9a59af08e5b10692972703 Mon Sep 17 00:00:00 2001 From: Jon Magnuson Date: Wed, 19 Jul 2023 07:38:16 -0500 Subject: [PATCH 1/5] ci: use sarif tools for clippy annotations --- .github/workflows/lint.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f8cc22e..8b9e947 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,9 +32,21 @@ jobs: - name: Install clippy run: rustup component add clippy - - name: Run clippy - uses: actions-rs/clippy-check@v1 + - name: Install annotation utils + run: cargo install clippy-sarif sarif-fmt + + - name: Run rust-clippy with: token: ${{ secrets.GITHUB_TOKEN }} - args: --all --bins --examples --tests --benches -- -Wclippy::all -Dwarnings + run: + cargo clippy + --all --bins --examples --tests --benches -- -Wclippy::all -Dwarnings + --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt + continue-on-error: true + + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: rust-clippy-results.sarif + wait-for-processing: true From 94b4b3d31ec22b7d3054df8ffe2d67f9dd545dd7 Mon Sep 17 00:00:00 2001 From: Jon Magnuson Date: Wed, 19 Jul 2023 07:40:23 -0500 Subject: [PATCH 2/5] fixup! ci: use sarif tools for clippy annotations --- .github/workflows/lint.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8b9e947..6c77d7a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,8 +36,6 @@ jobs: run: cargo install clippy-sarif sarif-fmt - name: Run rust-clippy - with: - token: ${{ secrets.GITHUB_TOKEN }} run: cargo clippy --all --bins --examples --tests --benches -- -Wclippy::all -Dwarnings From d898b8f7f23732b117c8457126ca15645cbf977a Mon Sep 17 00:00:00 2001 From: Jon Magnuson Date: Wed, 19 Jul 2023 07:48:16 -0500 Subject: [PATCH 3/5] temp! disable clippy allow --- src/reader.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reader.rs b/src/reader.rs index bfff00e..29fedef 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -332,7 +332,7 @@ impl StreamState { old_state } - #[allow(clippy::match_like_matches_macro)] // otherwise bumps MSRV + // #[allow(clippy::match_like_matches_macro)] // otherwise bumps MSRV pub fn is_transient(&self) -> bool { if let StreamState::Events = self { false From db1990b2950462a4c2bcf892a02274803cd04162 Mon Sep 17 00:00:00 2001 From: Jon Magnuson Date: Wed, 19 Jul 2023 07:59:19 -0500 Subject: [PATCH 4/5] fixup! ci: use sarif tools for clippy annotations --- src/reader.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/reader.rs b/src/reader.rs index 29fedef..5d5464c 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -334,6 +334,8 @@ impl StreamState { // #[allow(clippy::match_like_matches_macro)] // otherwise bumps MSRV pub fn is_transient(&self) -> bool { + let a_thing = 0usize; + if let StreamState::Events = self { false } else { From 0268f68f42d75ad504a19e5a078898732c53d89d Mon Sep 17 00:00:00 2001 From: Jon Magnuson Date: Wed, 19 Jul 2023 08:04:47 -0500 Subject: [PATCH 5/5] fixup! ci: use sarif tools for clippy annotations --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6c77d7a..c3bb93a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -38,8 +38,8 @@ jobs: - name: Run rust-clippy run: cargo clippy - --all --bins --examples --tests --benches -- -Wclippy::all -Dwarnings - --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt + --all --bins --examples --tests --benches --message-format=json -- -Wclippy::all -Dwarnings + | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt continue-on-error: true - name: Upload analysis results to GitHub