[Trivial] Make nightly formatting part of vscode settings#4416
[Trivial] Make nightly formatting part of vscode settings#4416fleupold wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
LGTM, trivial VSCode settings change to use nightly rustfmt locally.
Extended reasoning...
Overview
This PR only modifies .vscode/settings.json to add a rust-analyzer.rustfmt.overrideCommand configuration so that VSCode uses nightly rustfmt with edition 2024. It also reformats the JSON indentation from 4 to 2 spaces.
Security risks
None — this is a local editor configuration file and does not affect runtime behavior, build artifacts, or CI.
Level of scrutiny
Minimal. This is a developer-experience tweak scoped to VSCode users. It changes no Rust code, no infrastructure, and no settlement/auction logic. The repo's CI rustfmt configuration is unaffected.
Other factors
No bugs were reported by the bug hunting system. The change matches the stated intent in the description, and the title is explicitly labeled [Trivial].
There was a problem hiding this comment.
Code Review
This pull request updates the VS Code settings to override the rustfmt command using the nightly toolchain and the 2024 edition. Feedback highlights that hardcoding rustup is non-portable and the command lacks the --stdin-filepath flag necessary for locating configurations in multi-crate workspaces. It is recommended to update the rust-toolchain file instead to ensure consistency across environments.
| "rust-analyzer.rustfmt.overrideCommand": [ | ||
| "rustup", | ||
| "run", | ||
| "nightly", | ||
| "rustfmt", | ||
| "--edition=2024" | ||
| ] |
There was a problem hiding this comment.
Hardcoding rustup is non-portable and breaks formatting for contributors using other toolchain managers (e.g., Nix). Additionally, the command lacks --stdin-filepath "$SAVED_FILE", which is required for rustfmt to correctly locate the rustfmt.toml configuration in multi-crate workspaces.
Recommendation: Update the rust-toolchain file to nightly to ensure consistency across all tools (CLI, CI, IDE) without workspace-specific overrides.
"rust-analyzer.rustfmt.overrideCommand": [
"rustup",
"run",
"nightly",
"rustfmt",
"--edition=2024",
"--stdin-filepath",
"$SAVED_FILE"
]
Description
Currently checking out this repo with a clean vscode frequently leads to formatting issues, because we have chosen to format using nightly. Overriding this more globally may mess with other projects
Changes
.vscode/settings.jsonHow to test