Skip to content

Commit

Permalink
add clippy-sarif for pretty clippy output integrated with github
Browse files Browse the repository at this point in the history
  • Loading branch information
insipx committed Jan 29, 2025
1 parent b4127f2 commit 872a71b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/lint-ffi-bindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ jobs:
uses: actions/checkout@v4
- name: Update rust toolchains
run: rustup update
- uses: taiki-e/install-action@cargo-sarif
- uses: taiki-e/install-action@sarif-fmt
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
bindings_ffi
- name: Run clippy and fail on warnings
run: cargo clippy --locked --manifest-path bindings_ffi/Cargo.toml --all-features --all-targets --no-deps
run: cargo clippy --locked --manifest-path bindings_ffi/Cargo.toml --all-features --all-targets --no-deps --message-format=json | clippy-sarif | tee results.sarif | sarif-fmt
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
- name: Run format check
run: cargo fmt --manifest-path bindings_ffi/Cargo.toml --check
8 changes: 7 additions & 1 deletion .github/workflows/lint-node-bindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ jobs:
uses: actions/checkout@v4
- name: Update rust toolchains
run: rustup update
- uses: taiki-e/install-action@cargo-sarif
- uses: taiki-e/install-action@sarif-fmt
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
bindings_node
- name: Run clippy and fail on warnings
run: cargo clippy --locked --manifest-path bindings_node/Cargo.toml --all-features --all-targets --no-deps
run: cargo clippy --locked --manifest-path bindings_node/Cargo.toml --all-features --all-targets --no-deps --message-format=json | clippy-sarif | tee results.sarif | sarif-fmt
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
- name: Run format check
run: cargo fmt --manifest-path bindings_node/Cargo.toml --check
- name: Setup node
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/lint-wasm-bindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ jobs:
uses: actions/checkout@v4
- name: Update rust toolchains
run: rustup update
- uses: taiki-e/install-action@cargo-sarif
- uses: taiki-e/install-action@sarif-fmt
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
bindings_wasm
- name: Run clippy and fail on warnings
run: cargo clippy --manifest-path bindings_wasm/Cargo.toml --all-features --target wasm32-unknown-unknown --no-deps
run: cargo clippy --locked --manifest-path bindings_wasm/Cargo.toml --all-features --target wasm32-unknown-unknown --no-deps --message-format=json | clippy-sarif | tee results.sarif | sarif-fmt
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
- name: Run format check
run: cargo fmt --manifest-path bindings_wasm/Cargo.toml --check
8 changes: 7 additions & 1 deletion .github/workflows/lint-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ jobs:
uses: actions/checkout@v4
- name: Update rust toolchains
run: rustup update
- uses: taiki-e/install-action@cargo-sarif
- uses: taiki-e/install-action@sarif-fmt
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
- name: Run clippy and fail on warnings
# Exclude bindings_wasm since it only compiles for wasm32
run: cargo clippy --locked --workspace --all-features --all-targets --no-deps --exclude bindings_wasm
run: cargo clippy --locked --workspace --all-features --all-targets --no-deps --exclude bindings_wasm --message-format=json | clippy-sarif | tee results.sarif | sarif-fmt
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
- name: Run format check
run: cargo fmt --check

0 comments on commit 872a71b

Please sign in to comment.