CI: check the formatting with cargo fmt on all PRs #17

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

@⁠raffclar on GitHub · 2026-11-23 23:10 UTC · original
ci-fmt → main · +25 −0 · 1 files · 1 commits · closed without merging

Enforce common standard for code styling

**@⁠raffclar** on GitHub · 2026-11-23 23:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/17) `ci-fmt` → `main` · +25 −0 · 1 files · 1 commits · closed without merging Enforce common standard for code styling
A new workflow runs `cargo fmt --all -- --check` on each push to main
and on each pull request. It uses the toolchain that
rust-toolchain.toml gives and rustfmt.toml, so it agrees with a local
`cargo fmt`. It runs on Linux, because rustfmt does not compile code.

The tree is not formatted yet (26 files), so the check fails until a
`cargo fmt --all` commit is merged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:46:39 +00:00
github-bot closed this pull request 2026-11-26 03:46:39 +00:00
Author
Owner

@⁠PolpOnline on GitHub · 2026-11-23 23:12 UTC · original

@⁠raffclar Should also enforce tests on CI (at least those not depending on the binary being present)

**@⁠PolpOnline** on GitHub · 2026-11-23 23:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/17#issuecomment-7116671627) @⁠raffclar Should also enforce tests on CI (at least those not depending on the binary being present)
Author
Owner

@⁠raffclar on GitHub · 2026-11-23 23:13 UTC · original

Yeah I agree. I'm trying to do things in small chunks for easier review

**@⁠raffclar** on GitHub · 2026-11-23 23:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/17#issuecomment-7116713068) Yeah I agree. I'm trying to do things in small chunks for easier review
Author
Owner

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

Checked the gate this workflow adds, at main 97c78d1 with the pinned toolchain (rustfmt 1.98.1): the tree is not formatted yet, so the check fails before any PR is looked at.

  • cargo fmt --all -- --check: 141 hunks in 28 files, e.g. crates/victory-formats/src/texture.rs (10), xma.rs (9), xma/tables.rs (16), victory-gpu/src/host.rs (15), victory-hle/src/modules/xgamesave.rs (13), victory-loader/src/crash.rs (7).
  • With #39 stacked the same 141 hunks appear (that PR does not touch formatting).
  • So as written the workflow is red for every PR until the tree is formatted once; either cargo fmt --all should be part of this PR (before the gate is enabled) or the check should compare only the files a PR changes. Also worth pinning the rustfmt version to the rust-toolchain.toml one explicitly, since formatting differs between releases.

No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

**@⁠DaviTostes** on GitHub · 2026-11-24 00:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/17#issuecomment-7117710275) Checked the gate this workflow adds, at `main` `97c78d1` with the pinned toolchain (rustfmt 1.98.1): **the tree is not formatted yet**, so the check fails before any PR is looked at. - `cargo fmt --all -- --check`: **141 hunks in 28 files**, e.g. `crates/victory-formats/src/texture.rs` (10), `xma.rs` (9), `xma/tables.rs` (16), `victory-gpu/src/host.rs` (15), `victory-hle/src/modules/xgamesave.rs` (13), `victory-loader/src/crash.rs` (7). - With **#39** stacked the same 141 hunks appear (that PR does not touch formatting). - So as written the workflow is red for every PR until the tree is formatted once; either `cargo fmt --all` should be part of this PR (before the gate is enabled) or the check should compare only the files a PR changes. Also worth pinning the rustfmt version to the `rust-toolchain.toml` one explicitly, since formatting differs between releases. No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
Author
Owner

@⁠Quat3rnion on GitHub · 2026-11-24 00:37 UTC · original

The format gate here is red on current main: the tree has about 141 formatting hunks across 28 files. #112 formats the tree once and adds a Linux CI job that runs the format check, workspace tests and asset policy. Please consider closing this in favour of #112. Thanks for starting the CI work, @⁠raffclar.

**@⁠Quat3rnion** on GitHub · 2026-11-24 00:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/17#issuecomment-7118270566) The format gate here is red on current main: the tree has about 141 formatting hunks across 28 files. #112 formats the tree once and adds a Linux CI job that runs the format check, workspace tests and asset policy. Please consider closing this in favour of #112. Thanks for starting the CI work, @⁠raffclar.

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!17
No description provided.