Skip to content

Commit e178b73

Browse files
committed
[PM-29567] Pass clippy -D warnings on the command line
The clippy lint step set RUSTFLAGS=-D warnings for the whole step, which leaked into the from-source builds of clippy-sarif/sarif-fmt triggered by `cargo bin` in the same step. A warning in their transitive dependency serde-sarif then became a hard error and failed the build. Pass -D warnings to clippy directly instead, so the deny level applies only to the linted crates and not to the tool builds.
1 parent af6ce05 commit e178b73

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/lint.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ jobs:
103103

104104
- name: Run clippy with SARIF output
105105
if: matrix.check == 'clippy'
106-
env:
107-
RUSTFLAGS: "-D warnings"
108-
run: cargo clippy --all-features --all-targets --message-format=json |
106+
# Pass `-D warnings` to clippy directly rather than via RUSTFLAGS so the
107+
# deny level applies only to the linted crates, not to the from-source
108+
# builds of clippy-sarif/sarif-fmt that `cargo bin` triggers in this step
109+
# (some of their transitive deps emit warnings we don't control).
110+
run: cargo clippy --all-features --all-targets --message-format=json -- -D warnings |
109111
cargo bin clippy-sarif | tee clippy_result.sarif | cargo bin sarif-fmt
110112

111113
- name: Upload clippy results to GitHub

0 commit comments

Comments
 (0)