From 7d603b1fa1ba8f67a7add80ecdef3023610296b7 Mon Sep 17 00:00:00 2001 From: DataM0del <183248792+DataM0del@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:03:44 -0500 Subject: [PATCH 1/6] ci(rust.yml/jobs/clippy): integrate with GitHub Advanced Security / GitHub Code Scanning --- .github/workflows/rust.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 193c05eb..3b93c014 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,8 +31,13 @@ jobs: steps: - uses: actions/checkout@v4 - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - run: cargo install clippy-sarif - uses: Swatinem/rust-cache@v2 - - run: cargo clippy --all-targets --all-features + - run: cargo clippy --all-targets --all-features --message-format=json | clippy-sarif | tee results.sarif + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: results.sarif build_and_test: name: Build project and test runs-on: ${{ matrix.os }} From e95e5ca5b58f4f5f2d3e12bd8799129ad4887edf Mon Sep 17 00:00:00 2001 From: DataM0del <183248792+DataM0del@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:09:30 -0500 Subject: [PATCH 2/6] ci(rust.yml/jobs/clippy): upload the result file, even if the job fails --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3b93c014..7e2bd3fb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -36,6 +36,7 @@ jobs: - run: cargo clippy --all-targets --all-features --message-format=json | clippy-sarif | tee results.sarif - name: Upload analysis results to GitHub uses: github/codeql-action/upload-sarif@v3 + if: success() || failure() with: sarif_file: results.sarif build_and_test: From a2ad0b5d88a251f98ac7a34c0fac06c7d4acb7f3 Mon Sep 17 00:00:00 2001 From: DataM0del <183248792+DataM0del@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:12:03 -0500 Subject: [PATCH 3/6] ci(rust.yml/jobs/clippy): also upload the results when building in release mode --- .github/workflows/rust.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7e2bd3fb..64c092a4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -83,4 +83,9 @@ jobs: - uses: actions/checkout@v4 - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} - uses: Swatinem/rust-cache@v2 - - run: cargo clippy --release --all-targets --all-features + - run: cargo clippy --release --all-targets --all-features --message-format=json | clippy-sarif | tee results.sarif + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v3 + if: success() || failure() + with: + sarif_file: results.sarif From 76f75c4caaf25d7a62802e512db06cca04d8af85 Mon Sep 17 00:00:00 2001 From: DataM0del <183248792+DataM0del@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:14:25 -0500 Subject: [PATCH 4/6] ci(rust.yml/jobs/clippy_release): install clippy-sarif --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 64c092a4..a873a3f9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -83,6 +83,7 @@ jobs: - uses: actions/checkout@v4 - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} - uses: Swatinem/rust-cache@v2 + - run: cargo install clippy-sarif - run: cargo clippy --release --all-targets --all-features --message-format=json | clippy-sarif | tee results.sarif - name: Upload analysis results to GitHub uses: github/codeql-action/upload-sarif@v3 From 74ec8e7190eec30329e0c9cba3d78ea12323ac47 Mon Sep 17 00:00:00 2001 From: DataM0del <183248792+DataM0del@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:18:13 -0500 Subject: [PATCH 5/6] chore(pumpkin/src/main): add unused function to trigger clippy --- pumpkin/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pumpkin/src/main.rs b/pumpkin/src/main.rs index 5009e96f..e5a626ff 100644 --- a/pumpkin/src/main.rs +++ b/pumpkin/src/main.rs @@ -72,6 +72,10 @@ fn scrub_address(ip: &str) -> String { } } +fn unused_function() { + println!("I'm unused!") +} + fn init_logger() { use pumpkin_config::ADVANCED_CONFIG; if ADVANCED_CONFIG.logging.enabled { From 5c9391244352e93ef9a6a7db42af2cef38ea7164 Mon Sep 17 00:00:00 2001 From: DataM0del <183248792+DataM0del@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:20:52 -0500 Subject: [PATCH 6/6] revert: "chore(pumpkin/src/main): add unused function to trigger clippy" This reverts commit 74ec8e7190eec30329e0c9cba3d78ea12323ac47. --- pumpkin/src/main.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pumpkin/src/main.rs b/pumpkin/src/main.rs index e5a626ff..5009e96f 100644 --- a/pumpkin/src/main.rs +++ b/pumpkin/src/main.rs @@ -72,10 +72,6 @@ fn scrub_address(ip: &str) -> String { } } -fn unused_function() { - println!("I'm unused!") -} - fn init_logger() { use pumpkin_config::ADVANCED_CONFIG; if ADVANCED_CONFIG.logging.enabled {