Skip to content

fix(ci): lint every workspace member, and fix the wasm clippy failure it was hiding - #2962

Merged
robcohen merged 1 commit into
mainfrom
fix/clippy-all-workspace-members
Nov 12, 2026
Merged

robcohen merged 1 commit into
mainfrom
fix/clippy-all-workspace-members

Conversation

@robcohen

Copy link
Copy Markdown
Member

What

  • crates/rustledger-wasm/src/api.rs: load_errors_to_errors goes from pub(crate) to pub. The api module is private, so it stays crate-visible; this only silences clippy's redundant_pub_crate.
  • .github/workflows/ci.yml: the Check, Clippy and Documentation matrix entries now pass --workspace.

Why

Without --workspace, cargo acts on default-members only. The root Cargo.toml leaves rustledger-wasm, rustledger-ffi-wasi, rustledger-ffi-component and rustledger-ffi-component-tests out of default-members (its comment says "requires wasm32 target"), so CI never linted them. That is how #2952 landed a redundant_pub_crate failure: on main, cargo clippy -p rustledger-wasm --all-features --all-targets -- -D warnings fails at api.rs:31.

The default-members exclusion is not a host-build restriction: all four crates build, lint and document on x86_64 with --all-features (rustledger-wasm gates its wasm-only deps on cfg(target_arch = "wasm32") and its host-only ts-rs / schemars on the inverse; rustledger-ffi-component is a plain cdylib that also builds for the host). So a plain --workspace is enough; no per-crate step or special target is needed. MSRV (quality.yml), Documentation (private items) and the pre-push cargo-check hook already used --workspace.

How tested

Locally, on this branch:

  • cargo fmt --all --check
  • cargo clippy --workspace --all-features --all-targets -- -D warnings (the new CI command): passes
  • cargo check --workspace --all-features --all-targets (the new Check command): passes
  • RUSTDOCFLAGS=-Dwarnings cargo doc --workspace --no-deps and RUSTDOCFLAGS=-Dwarnings cargo doc --workspace --all-features --no-deps (the new Documentation command): pass
  • cargo test -p rustledger-wasm --all-features: passes

Other jobs with the same default-members gap (not changed here)

  • ci.yml Test: cargo nextest run --all-features runs no tests of the four excluded crates. Not a one-flag fix: under --all-features, rustledger-wasm's ts-export / json-schema tests regenerate binding files, and its wasm-bindgen tests need checking on the host runner, so it deserves its own PR. (rustledger-ffi-component-tests is already run by the Component Parity (wasip2) job.)
  • ci.yml Doctests: cargo test --doc --all-features skips doctests of the four excluded crates.
  • ci.yml Benchmarks Compile already uses --workspace; no gap.

🤖 Generated with Claude Code

… it was hiding

The Check, Clippy and Documentation jobs ran cargo without --workspace,
so they acted on default-members only, which leaves out rustledger-wasm,
rustledger-ffi-wasi, rustledger-ffi-component and
rustledger-ffi-component-tests. All four build on the host target, so
--workspace needs no extra target or feature set.

That gap let #2952 land a redundant_pub_crate failure in rustledger-wasm
(pub(crate) load_errors_to_errors inside the private api module). Make it
pub; the module stays private, so visibility is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@robcohen
robcohen requested a review from a team as a code owner November 12, 2026 12:31
@github-actions

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Shape rustledger beancount Speedup RSS (rledger / beancount)
simple 46.0ms ± 1.5ms 565.6ms ± 4.1ms 12.3x 45.1 MB / 51.0 MB
investment 68.9ms ± 1.3ms 2115.0ms ± 3.4ms 30.7x 47.1 MB / 58.9 MB
fifo 66.5ms ± 0.9ms 12067.5ms ± 275.1ms 181.4x 49.0 MB / 58.8 MB

vs base, measured in this run

Shape base this PR Change RSS base → PR
simple 46.4ms ± 2.6ms 46.0ms ± 1.5ms -1.0% ✅ within noise 45.1 MB → 45.1 MB (-0.0%)
investment 69.4ms ± 1.7ms 68.9ms ± 1.3ms -0.6% ✅ within noise 47.1 MB → 47.1 MB (+0.1%)
fifo 66.2ms ± 1.2ms 66.5ms ± 0.9ms +0.5% ✅ within noise 48.9 MB → 49.0 MB (+0.2%)

A difference counts only when it clears the combined spread of the two measurements, per shape (2σ: simple 1.3ms, investment 1.0ms, fifo 0.7ms), and is at least 5%.
10,000 transactions per shape · 20 runs, 3 warmup · hyperfine

What do these numbers mean?
  • simple — Two-posting transfers, one currency. The historical workload — keep as the floor, not as the benchmark.
  • investment — Cost specs, per-unit prices and lot reductions. Exercises booking and inventory, which simple leaves at 0.3%.
  • fifo — Bare {} reductions against a FIFO account — how FIFO sells are normally written. The other four shapes reach the ordered-selection path twice in 2k transactions between them, so it was effectively unprofiled until it turned out to be quadratic (plan_ordered scans every lot per reduction: FIFO ledgers are quadratic (8.8s at 20k transactions) #2083).
  • vs base: the PR and the base-branch commit it is built on, built and measured in the same job
  • RSS: peak resident set size, a single sample — reported without a verdict because there is no spread to test it against
  • A shape with no beancount column is one bean-check reports errors on; it is timed for rledger only

@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100% (raw 93%, 179 masked)
Full AST Match 100%
Total Files 826
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
    The headline is the EFFECTIVE rate, after pairs where beanquery
    itself is wrong are masked. raw is the same run with nothing
    masked. A widening gap means the registry grew, not that rledger
    changed.
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@robcohen
robcohen merged commit ab337cd into main Nov 12, 2026
51 of 52 checks passed
@robcohen
robcohen deleted the fix/clippy-all-workspace-members branch November 12, 2026 12:51
robcohen added a commit that referenced this pull request Nov 12, 2026
Conflict in crates/rustledger-wasm/src/api.rs: main made
load_errors_to_errors pub; this branch had added its doc comment.
Kept both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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