build(fmt): extend make fmt to the Solana preset tree - #436
Open
shahan-khatchadourian-anchorage wants to merge 1 commit into
Open
build(fmt): extend make fmt to the Solana preset tree#436shahan-khatchadourian-anchorage wants to merge 1 commit into
shahan-khatchadourian-anchorage wants to merge 1 commit into
Conversation
`cargo fmt` stops at `presets/mod.rs`, which declares its submodules
through `include!(concat!(env!("OUT_DIR"), ...))` -- rustfmt does not
follow an `include!` of a generated path, so no preset source is
formatted or checked. The CI gate (`make generated` followed by a
clean-tree check) inherits that blind spot.
Enumerate the preset sources in the `fmt` target so they are covered by
the same gate as the rest of `src/`, and reformat the 11 files that the
gate never saw. The reformat is pure re-wrapping; no tokens change.
Add `src/rustfmt.toml` pinning edition 2024 so running `rustfmt <file>`
directly on a preset matches what `cargo fmt` and the Makefile produce
(bare rustfmt otherwise defaults to edition 2015).
Closes #434
Copilot started reviewing on behalf of
shahan-khatchadourian-anchorage
August 4, 2026 20:30
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the workspace formatting gate so Solana preset sources under chain_parsers/visualsign-solana/src/presets/** (which are not reachable via cargo fmt due to an include!(OUT_DIR/...) module pattern) are formatted as part of the existing make -C src fmt / make -C src generated CI flow.
Changes:
- Updates
src/Makefilefmttarget tofindand runrustfmtover all Solana preset.rssources, and fail if the preset tree can’t be found. - Adds
src/rustfmt.tomlto pinedition = "2024"for consistent directrustfmtbehavior. - Applies rustfmt reflow to the 11 previously-unchecked Solana preset files.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/rustfmt.toml | Pins rustfmt edition to 2024 for consistent formatting runs. |
| src/Makefile | Extends make fmt to explicitly rustfmt Solana preset sources discovered via find. |
| src/chain_parsers/visualsign-solana/src/presets/drift/mod.rs | Mechanical rustfmt reflow (no functional changes). |
| src/chain_parsers/visualsign-solana/src/presets/exponent_finance/mod.rs | Mechanical rustfmt reflow (no functional changes). |
| src/chain_parsers/visualsign-solana/src/presets/jupiter_borrow/mod.rs | Mechanical rustfmt reflow (no functional changes). |
| src/chain_parsers/visualsign-solana/src/presets/jupiter_earn/mod.rs | Mechanical rustfmt reflow (no functional changes). |
| src/chain_parsers/visualsign-solana/src/presets/jupiter_perps/mod.rs | Mechanical rustfmt reflow (no functional changes). |
| src/chain_parsers/visualsign-solana/src/presets/kamino_borrow/mod.rs | Mechanical rustfmt reflow (no functional changes). |
| src/chain_parsers/visualsign-solana/src/presets/meteora_damm_v2/mod.rs | Mechanical rustfmt reflow (no functional changes). |
| src/chain_parsers/visualsign-solana/src/presets/meteora_dlmm/mod.rs | Mechanical rustfmt reflow (no functional changes). |
| src/chain_parsers/visualsign-solana/src/presets/neutral_trade/mod.rs | Mechanical rustfmt reflow (no functional changes). |
| src/chain_parsers/visualsign-solana/src/presets/orca_whirlpool/mod.rs | Mechanical rustfmt reflow (no functional changes). |
| src/chain_parsers/visualsign-solana/src/presets/swig_wallet/mod.rs | Mechanical rustfmt reflow (no functional changes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4 tasks
shahan-khatchadourian-anchorage
requested review from
pepe-anchor and
prasanna-anchorage
August 4, 2026 22:45
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.
Summary
Closes #434.
cargo fmtcannot reach any file underchain_parsers/visualsign-solana/src/presets/*/.presets/mod.rsdeclares its submodules through a generated include:rustfmt does not follow an
include!of a path that exists only after codegen, so it formatspresets/mod.rsand stops. CI's formatting gate ismake -C src generated(which callsmake fmt) followed by an "Ensure working tree is clean" check, so the gate inherits the same blind spot and every preset is unchecked.This PR:
fmttarget somake fmt-- and therefore the existing CI gate -- covers them. No new CI step.src/rustfmt.tomlpinningedition = "2024", so runningrustfmt <file>directly on a preset produces the same result ascargo fmtand the Makefile. Bare rustfmt otherwise defaults to edition 2015.findrather than a literal file list: presets are scaffolded one directory per program and the set grows with each new one, so a hardcoded list silently drops files out of the gate as it goes stale. The recipe echoes the file count (rustfmt 60 Solana preset sources) so a coverage regression is visible in CI logs without dumping 60 paths on one line. The target fails loudly if the directory ever moves.The
findis recursive rather thanpresets/*/*.rsbecause three files live one level deeper, underpresets/*/tests/.Files reformatted
Every hunk joins lines that now fit within the width limit -- pure re-wrapping, no tokens change. Largest single change is
swig_wallet/mod.rsat -13 net lines.Test plan
make -C src generatedthengit status --porcelainis empty -- reproduces CI's gate exactly and it now passesmake -C src fmtis idempotent (second run produces no diff)rustfmt --check; before this change 11 failedmake -C src lint-- clippy clean with-D warningscargo test -p visualsign-solana-- passesVerifying the gate actually bites
Introduce a formatting error in any preset and confirm CI now catches it:
Note
PR #381 is where this surfaced: a struct deletion left a stray double blank line and 17
create_text_field("Raw Data", ...)calls stayed wrapped after their argument got shorter, with CI green throughout. That PR touches onlypresets/spl_token/mod.rs, which is not in the list above, so there is no conflict with this branch and no ordering requirement between them.🤖 Generated with Claude Code