Skip to content

chore(template): Template Rust edition in rustfmt config #498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ rust_version: 1.85.0
# used in the operator-rs repository.
rust_nightly_version: nightly-2025-01-15

# This edition is mostly used for rustfmt commands and the rustfmt config file. The edition should
# be kept in line with the edition in the operator-rs repository.
rust_edition: 2024

# IMPORTANT
# If you change the Hadolint version here, make sure to also change the hook
# refs in the local and templated .pre-commit-config.yaml files.
Expand Down
2 changes: 2 additions & 0 deletions template/.vscode/settings.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"rust-analyzer.rustfmt.overrideCommand": [
"rustfmt",
"+{[rust_nightly_version}]",
"--edition",
"{[rust_edition}]",
"--"
],
}
2 changes: 1 addition & 1 deletion template/rustfmt.toml → template/rustfmt.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# It's also ok to use the stable toolchain by simple running "cargo fmt", but using the nigthly formatter is prefered.

# https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rustfmt-style-edition.html
style_edition = "2024"
style_edition = "{[rust_edition}]"
imports_granularity = "Crate"
group_imports = "StdExternalCrate"
reorder_impl_items = true
Expand Down