8000 chore(lint): make all-targets clippy pass and gate it in CI by adityamukho · Pull Request #895 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

chore(lint): make all-targets clippy pass and gate it in CI - #895

Merged
adityamukho merged 2 commits into
v3from
chore/clippy-all-targets
Nov 14, 2026
Merged

adityamukho merged 2 commits into
v3from
chore/clippy-all-targets

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

cargo clippy --all-targets -- -D warnings failed on v3 with 4,345 diagnostics, almost all in tests, benches and examples. CI only linted the library and binary, so they had never been checked. This makes it pass and adds --all-targets to the CI gate.

What changes

  • Test-only exemptions: a new clippy.toml turns on clippy's supported test-only settings: allow-unwrap-in-tests, allow-expect-in-tests, allow-panic-in-tests and allow-indexing-slicing-in-tests. 72 integration-test crate roots get #![cfg(test)], so their helper functions count as test code.
  • Benches and examples: the Criterion bench and three examples, which build outside a test scope, carry target-local allows for exactly the lints they trigger.
  • Real lints get real fixes: test-module casts become checked conversions, complex types get type aliases, approx_constant uses std::f64::consts, deprecated Criterion black_box becomes std::hint::black_box, and .err().expect() becomes expect_err(). Every assertion still checks the same values.
  • Production lints unchanged: [workspace.lints.clippy] is unchanged and no production library or binary code changes. A probe confirmed that non-test unwrap/expect/panic/indexing are still errors.
  • Dev-dependency: num-traits = "0.2" is added as a dev-dependency, for checked float conversions in the soak harness. It was already resolved transitively.
  • CI: lint.yml now runs cargo clippy --all-targets --all-features -- -D warnings.

Verification

  • cargo clippy --all-targets -- -D warnings and --all-targets --all-features: 4,345 / 4,645 errors before, 0 after.
  • cargo clippy --all-features, and the browser and WASI target clippies: still pass.
  • cargo test: 2,138 passed, 21 ignored, the same before and after.
  • cargo fmt --check: passes.

main needs the same lint.yml change as a separate PR, per the shared-CI rule.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H2a7QjCHpikfsg5qwAV1p9

Use shared test-only Clippy configuration, fix fixture and benchmark lints, and enforce all targets in the v3 lint workflow.

Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
@codecov
codecov Bot commented Nov 14, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

CI's stable clippy is newer than the toolchain the cleanup was checked
with and flags constant-size chunks_exact (as_chunks instead) and a
reversed sort_by comparator (sort_by_key with Reverse). Same iteration
and order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H2a7QjCHpikfsg5qwAV1p9
@adityamukho
adityamukho merged commit 61b5e84 into v3 Nov 14, 2026
24 checks passed
@adityamukho
adityamukho deleted the chore/clippy-all-targets branch November 14, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0