Skip to content

fix(magnetostatic): unbreak main's fmt and clippy gates#696

Merged
ecto merged 2 commits into
mainfrom
fix/magnetostatic-fmt
Jul 25, 2026
Merged

fix(magnetostatic): unbreak main's fmt and clippy gates#696
ecto merged 2 commits into
mainfrom
fix/magnetostatic-fmt

Conversation

@ecto

@ecto ecto commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Why

Grid-free magnetostatic oracle + fix cancelling multilayer coils (#692, 34f31195) landed with two CI gates unsatisfied, so main itself is red and every open PR fails for reasons unrelated to its own diff — including #695, which only touches crates/vcad-ecad-export/src/gerber.rs.

Both were verified against origin/main directly, not inferred from a PR run.

1. cargo fmt --check — the first step in the Rust job, so nothing after it ran:

$ git show origin/main:crates/vcad-kernel-magnetostatic/tests/magnet_model.rs > /tmp/mm.rs
$ rustfmt --edition 2021 --check /tmp/mm.rs
-        assert!(b.x.abs().max(b.y.abs()) < 1e-6 * want.abs(), "off-axis leakage");
+        assert!(
+            b.x.abs().max(b.y.abs()) < 1e-6 * want.abs(),
+            "off-axis leakage"
+        );

2. cargo clippy -- -D warnings — the next gate, which the format failure was masking. Fixing only the formatting moved the red one step down the job, which is exactly what the first push of this PR showed:

error: manual implementation of `.is_multiple_of()`
  --> crates/vcad-kernel-magnetostatic/src/magnet.rs:50:12
   |
50 |         if k % 2 == 0 {
   |            ^^^^^^^^^^ help: replace with: `k.is_multiple_of(2)`
   = note: `-D clippy::manual-is-multiple-of` implied by `-D warnings`

What

  • rustfmt --edition 2021 over crates/vcad-kernel-magnetostatic (9 files, 7 changed). No hand edits — every hunk is line-wrapping of a chained expression or a macro call.
  • k % 2 == 0k.is_multiple_of(2) in Polarity::alternating. Identical behaviour on usize.

Verified locally, with CI's exact invocations

  • cargo clippy --workspace --exclude vcad-desktop --features vcad-kernel-text/no-builtin-font -- -D warnings → clean. (Note CI does not pass --all-targets; with it, several unrelated crates have pre-existing test-only lints — out of scope here.)
  • cargo test -p vcad-kernel-magnetostatic → 20 passed.
  • rustfmt --check over the crate → clean.

Kept separate from #695 deliberately: an unrelated formatting-and-lint sweep does not belong in a Gerber export fix, and this unblocks every open PR, not just that one.

🤖 Generated with Claude Code

`Grid-free magnetostatic oracle` (#692) landed unformatted, so
`cargo fmt --check` fails on main and every open PR is red for a reason
that has nothing to do with its own diff.

Pure `rustfmt --edition 2021` output, no hand edits.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chojiai

chojiai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Choji has used up today's reviews

Your team has reached the free plan's limit of 5 reviews per day, so Choji stepped aside on this pull request. That's a plan limit, not a reflection of the change itself.

Your free reviews reset tomorrow. To have Choji review every push without waiting, upgrade to Pro for unlimited reviews.

You're on the free plan · 5 reviews/day.

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vcad-mcp Building Building Preview, Comment Jul 25, 2026 8:18pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
mecheval Ignored Ignored Jul 25, 2026 8:18pm
vcad Ignored Ignored Jul 25, 2026 8:18pm
vcad-docs Ignored Ignored Jul 25, 2026 8:18pm

Request Review

The same PR (#692) also trips clippy 1.95's manual_is_multiple_of, which
is the next gate after the format check — so main fails clippy too, and
fixing only the formatting just moved the red one step down the job.

`k % 2 == 0` -> `k.is_multiple_of(2)` on usize: identical behaviour.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ecto ecto changed the title style(magnetostatic): rustfmt the crate fix(magnetostatic): unbreak main's fmt and clippy gates Jul 25, 2026
@ecto
ecto merged commit eaf35c5 into main Jul 25, 2026
12 checks passed
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