Skip to content

[Trivial] Make nightly formatting part of vscode settings#4416

Open
fleupold wants to merge 2 commits into
mainfrom
vscode/rustfmt_nightly
Open

[Trivial] Make nightly formatting part of vscode settings#4416
fleupold wants to merge 2 commits into
mainfrom
vscode/rustfmt_nightly

Conversation

@fleupold
Copy link
Copy Markdown
Contributor

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

  • Specify the nightly rustfmt command in .vscode/settings.json

How to test

  • Make a change, see imports not being reordered on save

@fleupold fleupold requested a review from a team as a code owner May 15, 2026 15:00
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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].

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .vscode/settings.json
Comment on lines +6 to +12
"rust-analyzer.rustfmt.overrideCommand": [
"rustup",
"run",
"nightly",
"rustfmt",
"--edition=2024"
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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"
  ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant