[GH-ISSUE #1492] [Feature]: Pin Rust formatting toolchain and normalize rustfmt drift #749

Closed
opened 2026-10-20 17:32:46 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Xelvanis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1492

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

cargo fmt --all can produce unrelated Rust wrapping churn because the repo does not currently pin the Rust toolchain or rustfmt configuration. That means different contributors, agents, or CI environments may apply different rustfmt defaults across untouched Rust files.

This makes feature and bugfix PRs noisier, increases merge conflict risk for Rust work, and makes review/blame less clear.

Proposed behavior

Add a dedicated contributor-workflow chore PR that:

  1. Pins the supported Rust toolchain, preferably matching the version already expected by CI.
  2. Adds an explicit rustfmt.toml only if maintainers want repo-level formatting rules beyond stable defaults.
  3. Runs one intentional cargo fmt --all normalization across the Rust workspace.
  4. Keeps that formatting-only churn separate from behavior-changing feature or bugfix PRs.
  5. Verifies the normalized state with cargo fmt --all --check and cargo check --manifest-path src-tauri/Cargo.toml.

Expected owner or impact area

  • App shell, navigation, startup, or providers
  • Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Refactor branch considerations

This should be isolated as a no-behavior-change chore PR. The main risk is one-time Rust formatting churn and merge conflicts for active Rust branches, not app behavior.

Before landing, choose a Rust version that matches CI/support expectations so the toolchain pin does not accidentally introduce compiler-version drift.

If a broad formatting commit is made, consider adding or using an ignore-revs file so future blame can skip the normalization commit.

Alternatives considered

Leave the repo unpinned and ask contributors/agents to avoid broad cargo fmt --all runs. That avoids one-time churn, but it keeps the same formatting drift risk and makes future Rust PRs more likely to include unrelated wrapping changes.

Additional context

This came from local formatting workflow discussion during the issue #1457 slice. A duplicate search for open issues/PRs mentioning rustfmt, cargo fmt, rust-toolchain, or formatting toolchain did not find an existing owner.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (May 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1492 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? `cargo fmt --all` can produce unrelated Rust wrapping churn because the repo does not currently pin the Rust toolchain or rustfmt configuration. That means different contributors, agents, or CI environments may apply different rustfmt defaults across untouched Rust files. This makes feature and bugfix PRs noisier, increases merge conflict risk for Rust work, and makes review/blame less clear. ## Proposed behavior Add a dedicated contributor-workflow chore PR that: 1. Pins the supported Rust toolchain, preferably matching the version already expected by CI. 2. Adds an explicit `rustfmt.toml` only if maintainers want repo-level formatting rules beyond stable defaults. 3. Runs one intentional `cargo fmt --all` normalization across the Rust workspace. 4. Keeps that formatting-only churn separate from behavior-changing feature or bugfix PRs. 5. Verifies the normalized state with `cargo fmt --all --check` and `cargo check --manifest-path src-tauri/Cargo.toml`. ## Expected owner or impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [x] Docs, contributor workflow, or templates ## Refactor branch considerations This should be isolated as a no-behavior-change chore PR. The main risk is one-time Rust formatting churn and merge conflicts for active Rust branches, not app behavior. Before landing, choose a Rust version that matches CI/support expectations so the toolchain pin does not accidentally introduce compiler-version drift. If a broad formatting commit is made, consider adding or using an ignore-revs file so future blame can skip the normalization commit. ## Alternatives considered Leave the repo unpinned and ask contributors/agents to avoid broad `cargo fmt --all` runs. That avoids one-time churn, but it keeps the same formatting drift risk and makes future Rust PRs more likely to include unrelated wrapping changes. ## Additional context This came from local formatting workflow discussion during the issue #1457 slice. A duplicate search for open issues/PRs mentioning `rustfmt`, `cargo fmt`, `rust-toolchain`, or formatting toolchain did not find an existing owner. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:32:46 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (May 29, 2026):

Resolved on refactor in a706b274. Added rust-toolchain.toml pinned to Rust 1.95.0 with rustfmt/clippy, then normalized Rust formatting with cargo fmt.

<!-- gh-comment-id:4571930565 --> @SpicyMarinara commented on GitHub (May 29, 2026): Resolved on refactor in a706b274. Added rust-toolchain.toml pinned to Rust 1.95.0 with rustfmt/clippy, then normalized Rust formatting with cargo fmt.
Sign in to join this conversation.
No milestone
No project
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
Pasta-Devs/Marinara-Engine#749
No description provided.