Skip to content

Make the Rust code clippy clean and check fmt and clippy in CI - #49

Merged
chrislaupama merged 6 commits into
mainfrom
lint-rust
Nov 12, 2026
Merged

chrislaupama merged 6 commits into
mainfrom
lint-rust

Conversation

@chrislaupama

Copy link
Copy Markdown
Collaborator

What

Closes #38 (second half; #42 was the reformat).

  • Clippy clean, one commit per crate. cargo clippy --workspace --all-targets -- -D warnings now passes. Most findings are fixed (iterators instead of index loops, clamp, is_multiple_of, struct-update initialisers, FRAC_1_SQRT_2 in the EQ tests, redundant closures and casts). Allowed, each with a reason:

    • large_enum_variant on Command and AssistantAction: built once per edit, never on the audio path; boxing Track would touch every caller.
    • too_many_arguments on clipper_transfer (one argument per device parameter), and too_many_arguments plus type_complexity across the app crate, where drawing and layout code passes geometry and state as plain arguments.
    • one negated float comparison in live_import.rs that has to reject NaN.

    Two !(x > 0.0) checks became explicit x.is_nan() || x <= 0.0, same behaviour.

  • CI. lint runs cargo fmt --all --check; tests (Linux) runs clippy over every target with warnings as errors. Both use a pinned toolchain (RUST_LINT_TOOLCHAIN, 1.97.0), so a new stable Rust can't turn CI red overnight; builds and tests stay on stable.

  • .git-blame-ignore-revs lists the rustfmt commit from Format the Rust workspace with rustfmt #42, so blame skips it.

  • AGENTS.md, CONTRIBUTING.md and the PR skills give the exact clippy command CI runs.

cargo test --workspace passes locally (all suites), and fmt, clippy and actionlint are clean.

Screenshots

No visual change.

Benchmarks

No behaviour change intended: the edits are equivalent rewrites (iterator forms of the same loops, clamp for min().max() with constant bounds). The Performance workflow's time and instruction-count checks on this PR cover the app and engine paths.

Docs

  • README.md is still accurate
  • AGENTS.md, CONTRIBUTING.md and the skills updated

Generated by Claude Code

Fixes the clippy findings in dstudio-core (including the deny-level
approx_constant in the EQ tests) and allows two lints where the fix
doesn't fit: large_enum_variant on Command and AssistantAction (built once
per edit, boxing Track would touch every caller) and too_many_arguments on
clipper_transfer (one argument per device parameter).

!(x > 0.0) in AddAsset becomes an explicit NaN check with the same
meaning.
Fixes the clippy findings in the app crate. too_many_arguments and
type_complexity are allowed crate-wide (drawing and layout code passes
geometry and state as plain arguments), and one negated float comparison
in live_import.rs stays as is because it must reject NaN.
lint runs cargo fmt --all --check and tests (Linux) runs clippy over every
target with warnings as errors, both on a pinned toolchain
(RUST_LINT_TOOLCHAIN) so a new stable Rust can't turn CI red overnight.
@chrislaupama chrislaupama self-assigned this Nov 12, 2026
@chrislaupama
chrislaupama merged commit f336da4 into main Nov 12, 2026
16 checks passed
@chrislaupama
chrislaupama deleted the lint-rust branch November 12, 2026 07:11
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.

Make the Rust code rustfmt and clippy clean, then check both in CI

1 participant