Skip to content

fix(lint): clear the clippy backlog the revived Rust CI exposed - #361

Merged
hyperpolymath merged 2 commits into
mainfrom
fix/clippy-backlog
Jul 27, 2026
Merged

fix(lint): clear the clippy backlog the revived Rust CI exposed#361
hyperpolymath merged 2 commits into
mainfrom
fix/clippy-backlog

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Why main is currently red

PR #358 revived Rust CI. It merged before this commit landed on the branch, so main
now has a working Rust CI that immediately fails its Cargo check + clippy + fmt step.

That is not a regression — it is the gate doing its job for the first time since
2026-06-27. This PR is the backlog it found.

Current state of the revived gate on main (d7f1b49):

success  wasm-tools validate (emitted modules)
success  Cargo build + test (ephapax-cli, --no-default-features)
success  rust-ci / Detect Cargo.toml
failure  rust-ci / Cargo check + clippy + fmt     <-- this PR

What this fixes

cargo clippy --all-targets -- -D warnings failed crate after crate. All resolved;
it now exits 0.

Mechanical, behaviour-preserving:

Lint Fix
derivable_impls impl Default for Visibility#[derive(Default)] + #[default]
manual_try_fold ×2 .fold(Ok(acc), ..).try_fold(acc, ..) in the surface and core parsers' statement-sequence desugaring
collapsible_if ×2, match_like_matches_macro via cargo clippy --fix
ptr_arg &PathBuf&Path in two ephapax-cli signatures
unnecessary_unsafe removed an empty unsafe {} block wrapping only comments in a placeholder test

That last one is worth a second look in a language whose entire thesis is memory safety:
ephapax-runtime::list::tests::test_list_new contained unsafe { /* comments only */ }.

Deliberately allowed, each with an inline reason (no blanket crate-level allow):

  • approx_constantlex("3.14") is a float literal under test, not an approximation of PI
  • type_complexity — replaced with a TokenPredicate type alias
  • too_many_arguments ×3 — 8 params vs clippy's default threshold of 7, on option-heavy CLI
    entry points and the recursive import resolver
  • large_enum_variantValue::Closure is ~264 bytes vs ~48 for the next largest, so every
    Value pays for it. The real fix is boxing the payload, which touches every construction
    and match site in the interpreter. That is a behavioural-risk refactor that does not
    belong in a CI-infrastructure change. Allowed here with a comment, tracked in clippy: box the Value::Closure payload (large_enum_variant, currently allowed) #360.

Verification — all local, all green

cargo check --locked --all-targets          ok
cargo clippy --all-targets -- -D warnings   exit 0
cargo fmt --all -- --check                  clean
cargo test --workspace                      285 passed, 0 failed

The 285 passing tests matter here: the try_fold rewrites and the unsafe removal are the
only changes that could alter behaviour, and the parser/interpreter suites cover both.

🤖 Generated with Claude Code

Second wave of fallout from reviving Rust CI. With `clippy --all-targets -- -D warnings`
running for the first time, the workspace failed crate after crate. All fixed here;
`cargo clippy --all-targets -- -D warnings` now exits 0.

Mechanical, behaviour-preserving:
- `derivable_impls`      — `impl Default for Visibility` -> `#[derive(Default)]` + `#[default]`
- `manual_try_fold` (x2) — `.fold(Ok(acc), ..)` -> `.try_fold(acc, ..)` in both the surface
                           and core parsers' statement-sequence desugaring
- `collapsible_if` (x2), `match_like_matches_macro` — via `cargo clippy --fix`
- `ptr_arg`              — `&PathBuf` -> `&Path` in two ephapax-cli signatures
- `unnecessary_unsafe`   — removed an EMPTY `unsafe {}` block that wrapped only comments
                           in a placeholder test (`ephapax-runtime::list`). Worth noting in
                           a language whose thesis is memory safety.

Deliberately allowed, each with an inline reason rather than a blanket crate-level allow:
- `approx_constant`      — `lex("3.14")` is a float literal UNDER TEST, not an approximation
                           of PI
- `type_complexity`      — introduced a `TokenPredicate` type alias instead
- `too_many_arguments` (x3) — 8 params against clippy's default threshold of 7, on
                           option-heavy CLI entry points and the recursive import resolver
- `large_enum_variant`   — `Value::Closure` is ~264 bytes vs ~48 for the next largest, so
                           every `Value` pays for it. The fix is to box the payload, which
                           touches every construction and match site in the INTERPRETER.
                           That is a behavioural-risk refactor and does not belong inside a
                           CI-infrastructure change, so it is allowed here with a comment
                           and tracked in #360.

Verification, all local and all green:
  cargo check --locked --all-targets   ok
  cargo clippy --all-targets -- -D warnings   exit 0
  cargo fmt --all -- --check           clean
  cargo test --workspace               285 passed, 0 failed

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hyperpolymath
hyperpolymath marked this pull request as ready for review July 27, 2026 18:35
@hyperpolymath
hyperpolymath merged commit 2994db1 into main Jul 27, 2026
@hyperpolymath
hyperpolymath deleted the fix/clippy-backlog branch July 27, 2026 18:36
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