QA: add rustfmt.toml to standardize workspace formatting #547

Closed
github-bot wants to merge 1 commit from gh-pr/547/head into gh-pr/547/base
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 04:43 UTC · original
pushkarreddyy:qa/rustfmt-config → main · +4 −1 · 1 files · 1 commits · closed without merging

Motivation

The VIctory workspace is built on the Rust 2024 edition (edition = "2024" in Cargo.toml). Without an explicit rustfmt.toml in the repository root:

  1. rustfmt defaults to Rust 2015/2021 when executed by IDEs, text editors (e.g. rust-analyzer formatting on save), or ad-hoc cargo fmt commands without --edition 2024.
  2. This causes formatting errors on modern 2024 syntax features (such as C-string literals c"..." and let-chains).
  3. Line endings could vary across Windows and non-Windows contributors.

Solution

  • Added rustfmt.toml to 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.

**@⁠pushkarreddyy** on GitHub · 2026-11-24 04:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/547) `pushkarreddyy:qa/rustfmt-config` → `main` · +4 −1 · 1 files · 1 commits · closed without merging ## Motivation The VIctory workspace is built on the Rust 2024 edition (`edition = "2024"` in `Cargo.toml`). Without an explicit `rustfmt.toml` in the repository root: 1. `rustfmt` defaults to Rust 2015/2021 when executed by IDEs, text editors (e.g. rust-analyzer formatting on save), or ad-hoc `cargo fmt` commands without `--edition 2024`. 2. This causes formatting errors on modern 2024 syntax features (such as C-string literals `c"..."` and let-chains). 3. Line endings could vary across Windows and non-Windows contributors. ## Solution - Added `rustfmt.toml` to 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:07:54 +00:00
github-bot closed this pull request 2026-11-26 04:07:54 +00:00
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 04:51 UTC · original

### Technical Verification & Implementation Details

Context & Architecture

The VIctory workspace is built on Rust 2024 edition (edition = "2024" in Cargo.toml). Without an explicit rustfmt.toml in the repository root:

  1. rustfmt defaults to 2015/2021 when executed by IDEs (e.g. rust-analyzer formatting on save) or raw cargo fmt without explicit CLI flags.
  2. This causes formatting errors on modern 2024 syntax (such as C-string literals c"..." and let-chains).
  3. Line endings vary across Windows and non-Windows contributors.

Changes & Configuration

  • Added root rustfmt.toml:
    • edition = "2024"
    • newline_style = "Unix"
    • use_field_init_shorthand = true
    • use_try_shorthand = true

Git Log Line & Verification

ext 55aea2c QA: add rustfmt.toml to standardize workspace formatting rustfmt.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)

  • Passes cargo xtask policy (Rule #1 compliance, zero game assets).
  • Formatted with rustfmt --edition 2024.
**@⁠pushkarreddyy** on GitHub · 2026-11-24 04:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/547#issuecomment-7122407713) ### Technical Verification & Implementation Details #### Context & Architecture The VIctory workspace is built on Rust 2024 edition (`edition = "2024"` in `Cargo.toml`). Without an explicit `rustfmt.toml` in the repository root: 1. `rustfmt` defaults to 2015/2021 when executed by IDEs (e.g. rust-analyzer formatting on save) or raw `cargo fmt` without explicit CLI flags. 2. This causes formatting errors on modern 2024 syntax (such as C-string literals `c"..."` and let-chains). 3. Line endings vary across Windows and non-Windows contributors. #### Changes & Configuration - Added root `rustfmt.toml`: - `edition = "2024"` - `newline_style = "Unix"` - `use_field_init_shorthand = true` - `use_try_shorthand = true` #### Git Log Line & Verification ` ext 55aea2c QA: add rustfmt.toml to standardize workspace formatting rustfmt.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ` - Passes `cargo xtask policy` (Rule #1 compliance, zero game assets). - Formatted with `rustfmt --edition 2024`.
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 06:24 UTC · original

### Call for Maintainer Review & Merge
Infrastructure and quality assurance improvement:

  • Enforces Rule #1 asset policy and code style consistency across the repository.
  • Non-breaking, zero dependencies on game files.
  • Helps maintainers manage the influx of incoming PRs by automating gates.

@⁠Marvisak: Ready for review and merge when convenient!

**@⁠pushkarreddyy** on GitHub · 2026-11-24 06:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/547#issuecomment-7123904710) ### Call for Maintainer Review & Merge Infrastructure and quality assurance improvement: - Enforces Rule #1 asset policy and code style consistency across the repository. - Non-breaking, zero dependencies on game files. - Helps maintainers manage the influx of incoming PRs by automating gates. @⁠Marvisak: Ready for review and merge when convenient!
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 07:33 UTC · original

Thank you @⁠mercuryVM for the thorough review and testing on Windows 11 / MSVC! Appreciate the confirmation and approval.

**@⁠pushkarreddyy** on GitHub · 2026-11-24 07:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/547#issuecomment-7125113069) Thank you @⁠mercuryVM for the thorough review and testing on Windows 11 / MSVC! Appreciate the confirmation and approval.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:24 UTC · original

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.

**@⁠Marvisak** on GitHub · 2026-11-25 00:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/547#issuecomment-7148481967) 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

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!547
No description provided.