Skip to content
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: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
persist-credentials: false

- name: Install toolchain
run: rustup toolchain install nightly --component rustfmt
run: rustup component add rustfmt

- name: Run rustfmt checks
run: rustup run nightly cargo fmt --check --all
run: cargo fmt --check --all

lint:
name: Lint
Expand Down
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"**/Cargo.lock": true,
".git/": true
},
"rust-analyzer.rustfmt.extraArgs": [
"+nightly"
],
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features",
"editor.tabSize": 2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Opinionated template for multi-crate Rust workspaces, with:

The following software is expected to be installed and available in `PATH`:

- [rustup][rustup] – Rust toolchain manager. Both the stable and nightly toolchains are used: nightly for `rustfmt` (`rustfmt.toml` contains unstable options), stable for everything else.
- [rustup][rustup] – Rust toolchain manager. Only the stable toolchain is used.
- [just][just] – Command runner. See the `justfile` for available recipes.
- [taplo][taplo] – TOML formatter. Configured by `taplo.toml`.
- [markdownlint-cli2][markdownlint-cli2] – Markdown linter. Configured by `.markdownlint.json`.
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ default:

# Run rustfmt
fmt:
cargo +nightly fmt --all
cargo fmt --all

# Check whether the code compiles
check:
Expand Down
23 changes: 14 additions & 9 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# Reference: https://rust-lang.github.io/rustfmt/

condense_wildcard_suffixes = true
format_macro_bodies = false
format_macro_matchers = false
group_imports = "Preserve"
imports_granularity = "One"
match_block_trailing_comma = true
normalize_comments = true
normalize_doc_attributes = true
overflow_delimited_expr = true
reorder_impl_items = true
single_line_if_else_max_width = 0
single_line_let_else_max_width = 0
style_edition = "2024"
use_field_init_shorthand = true
use_try_shorthand = true

# The following options are nightly-only. They are commented out because we
# format with the stable toolchain; uncomment when any one of them becomes
# available in stable.

# condense_wildcard_suffixes = true
# format_macro_bodies = false
# format_macro_matchers = false
# group_imports = "Preserve"
# imports_granularity = "One"
# normalize_comments = true
# normalize_doc_attributes = true
# overflow_delimited_expr = true
# reorder_impl_items = true
Loading