Repository navigation
Make the Rust code clippy clean and check fmt and clippy in CI - #49
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #38 (second half; #42 was the reformat).
Clippy clean, one commit per crate.
cargo clippy --workspace --all-targets -- -D warningsnow passes. Most findings are fixed (iterators instead of index loops,clamp,is_multiple_of, struct-update initialisers,FRAC_1_SQRT_2in the EQ tests, redundant closures and casts). Allowed, each with a reason:large_enum_variantonCommandandAssistantAction: built once per edit, never on the audio path; boxingTrackwould touch every caller.too_many_argumentsonclipper_transfer(one argument per device parameter), andtoo_many_argumentsplustype_complexityacross the app crate, where drawing and layout code passes geometry and state as plain arguments.live_import.rsthat has to reject NaN.Two
!(x > 0.0)checks became explicitx.is_nan() || x <= 0.0, same behaviour.CI.
lintrunscargo 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-revslists 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 --workspacepasses 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,
clampformin().max()with constant bounds). The Performance workflow's time and instruction-count checks on this PR cover the app and engine paths.Docs
Generated by Claude Code