Skip to content

style: rustfmt loops.rs and stable_packed_accumulator.rs — main is red on cargo fmt --check - #9293

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
proggeramlug:fix/fmt-main-9274-9279
Aug 31, 2026
Merged

style: rustfmt loops.rs and stable_packed_accumulator.rs — main is red on cargo fmt --check#9293
proggeramlug merged 1 commit into
PerryTS:mainfrom
proggeramlug:fix/fmt-main-9274-9279

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

cargo fmt --all -- --check fails on pristine main (953a8bdd90): 6 hunks across crates/perry-codegen/src/stmt/loops.rs and crates/perry-codegen/src/stmt/stable_packed_accumulator.rs, introduced by #9274/#9279. Reproduced independently on two machines with the pinned nightly toolchain.

That check is part of the lint job, so it is currently red on every open PR, and a gate that is red on arrival is CLAUDE.md hazard 2 — it teaches reviewers to merge past red, and the next real lint failure lands invisibly behind it.

This is pure cargo fmt --all output. No hand edits, no behaviour change. cargo fmt --all -- --check is clean afterwards.

Found while verifying an unrelated runtime change (#9291), which does not touch either file.

Summary by CodeRabbit

  • Refactor
    • Reformatted internal code for improved readability and consistency.
    • No user-visible behavior or functionality changes.

… on cargo fmt --check)

`cargo fmt --all -- --check` fails on pristine main (953a8bd): 6 hunks
across `perry-codegen/src/stmt/loops.rs` and
`perry-codegen/src/stmt/stable_packed_accumulator.rs`, from PerryTS#9274/PerryTS#9279.
Reproduced on two machines with the pinned nightly toolchain.

That gate is part of `lint`, so it is red on every open PR until this lands,
and a check that is red on arrival teaches reviewers to ignore it — CLAUDE.md
hazard 2.

Pure `cargo fmt --all` output, no hand edits, no behaviour change.

Claude-Session: https://claude.ai/code/session_01TE3JXAYXtdnKcLu8TCFWR6
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b2be0574-fd98-4878-9490-8859d12288b6

📥 Commits

Reviewing files that changed from the base of the PR and between 953a8bd and 3d27bd6.

📒 Files selected for processing (2)
  • crates/perry-codegen/src/stmt/loops.rs
  • crates/perry-codegen/src/stmt/stable_packed_accumulator.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The change reformats recursive accumulator checks and numeric accumulator collection calls in the code generator. It does not alter declarations, arguments, or behavior.

Changes

Numeric accumulator cleanup

Layer / File(s) Summary
Reformat accumulator calls
crates/perry-codegen/src/stmt/stable_packed_accumulator.rs, crates/perry-codegen/src/stmt/loops.rs
Recursive calls and collection calls use expanded argument formatting. Expression bodies replace equivalent block bodies. No logic changes.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 3d27b

This PR only reformats existing Rust code and restores the formatting check without changing behavior, interfaces, dependencies, or deployment behavior. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: jdalton, thehypnoo

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Rust formatting changes and explains that they fix the failing cargo fmt --check on main.
Description check ✅ Passed The description clearly explains the formatting-only change, affected files, reason, and verification command. It does not use the repository template headings or include the checklist, but the key in…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description clearly explains the formatting-only change, affected files, reason, and verification command. It does not use the repository template headings or include the checklist, but the key information is present.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Merged — and this is my mess, not a drive-by. Thank you for catching it.

main was genuinely red: cargo fmt --all -- --check reports loops.rs:872 and three sites in stable_packed_accumulator.rs. Confirmed against a clean origin/main checkout before merging, and confirmed this branch makes it clean.

How I produced it, since the mechanism will recur. I have been batching PRs onto a shared branch, running cargo fmt --all there, committing the result, and validating the batch. Then I split the batch back into individual PRs and merge each — carrying only the files each PR needed. The formatting commit lived on the train, never on any PR head, so every batch merged unformatted while my own run_lint_gates.sh reported 60/60 on the branch I'd formatted. A green that describes a tree nobody merges.

Both files here are ones several of those batched PRs touched (#9274, #9279, #9288 among them), which is exactly why the drift landed there and nowhere else.

The fix on my side is that the formatting has to be pushed to the PR whose code needs it, or the batch has to merge as the batch. I have been treating the train as a validation vehicle and the PR heads as the thing that ships, without noticing that fixes I applied to the former never reached the latter.

Style-only, no behaviour change; cargo fmt --check clean on the merged result.

@proggeramlug
proggeramlug merged commit 7a6d5a1 into PerryTS:main Aug 31, 2026
24 of 29 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