QA: add rustfmt.toml to standardize workspace formatting #547
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/547"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T04:43:58Z.
Motivation
The VIctory workspace is built on the Rust 2024 edition (
edition = "2024"inCargo.toml). Without an explicitrustfmt.tomlin the repository root:rustfmtdefaults to Rust 2015/2021 when executed by IDEs, text editors (e.g. rust-analyzer formatting on save), or ad-hoccargo fmtcommands without--edition 2024.c"..."and let-chains).Solution
rustfmt.tomlto the workspace root:edition = "2024": Automatically sets the format parser to Rust 2024.newline_style = "Unix": Enforces consistent LF line endings across all platforms.use_field_init_shorthand = true: Standardizes struct field initialization.use_try_shorthand = true: Standardizes?operator usage.No game files used.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T06:48:30Z.
Review: APPROVED
Tested
55aea2con Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (264 passed, 0 failed).cargo fmt --all --checkreports the same 168 diff hunks with and without this file, so it changes nothingcargo fmtproduces today.max_width = 100is neutral, since 100 is rustfmt's default.newline_style = "Unix"matches.gitattributes(* text=auto eol=lf), so it won't fight checkouts.edition = "2024"only matters for standalonerustfmtand editors, which is the point.cargo fmtalready takes the edition fromCargo.toml.use_try_shorthandonly rewritestry!, which 2024 code can't use anyway, so it is a no-op here.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T04:51:55Z.
### Technical Verification & Implementation Details
Context & Architecture
The VIctory workspace is built on Rust 2024 edition (
edition = "2024"inCargo.toml). Without an explicitrustfmt.tomlin the repository root:rustfmtdefaults to 2015/2021 when executed by IDEs (e.g. rust-analyzer formatting on save) or rawcargo fmtwithout explicit CLI flags.c"..."and let-chains).Changes & Configuration
rustfmt.toml:edition = "2024"newline_style = "Unix"use_field_init_shorthand = trueuse_try_shorthand = trueGit Log Line & Verification
ext 55aea2c QA: add rustfmt.toml to standardize workspace formatting rustfmt.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)cargo xtask policy(Rule #1 compliance, zero game assets).rustfmt --edition 2024.Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T06:24:42Z.
### Call for Maintainer Review & Merge
Infrastructure and quality assurance improvement:
@Marvisak: Ready for review and merge when convenient!
Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T07:33:02Z.
Thank you @mercuryVM for the thorough review and testing on Windows 11 / MSVC! Appreciate the confirmation and approval.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T12:46:07Z.
Review: COMMENTED
The config additions themselves are reasonable (
edition = "2024"matches the workspace,use_try_shorthand, Unix newlines), but this cannot land alone: applying thisrustfmt.tomlto current main makescargo fmt --all -- --checkreport 179 diffs across the workspace (mostly fromuse_try_shorthandrewritingtry!-style/.map_errpatterns and reflowinglower.rs,threads.rs, etc.).Verified locally on macOS (rustc 1.98.1): with the PR's
rustfmt.tomlin place,cargo fmt --all -- --checkexits non-zero with 179 "Diff in" hunks; with main's currentrustfmt.tomlthe tree is clean.Please bundle a workspace-wide
cargo fmtcommit with this change (or land the reformat first), otherwise every PR's formatting check (#540's changed-file rustfmt step, #545'sxtask qa) starts flagging untouched code.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:24:44Z.
Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed