chore: document rustfmt options (#2055)

This commit is contained in:
Josh McKinney 2025-09-01 08:48:09 -07:00 committed by GitHub
parent 9a4f5af613
commit 46e7c6cbbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,12 +1,23 @@
# configuration for https://rust-lang.github.io/rustfmt/ # Configuration for https://rust-lang.github.io/rustfmt/
edition = "2024"
# E.g. Foo { a, b, c }
use_field_init_shorthand = true use_field_init_shorthand = true
# unstable options # Unstable options. These require a nightly compiler to use (cargo +nightly fmt).
# We choose a wider comment width, as this tends to make comments more readable than truncating at
# 80 characters.
wrap_comments = true
comment_width = 100 comment_width = 100
format_code_in_doc_comments = true format_code_in_doc_comments = true
format_macro_matchers = true
# `#[doc = "..."]` -> `/// ...`
normalize_doc_attributes = true
# We choose module granularity for imports as this tends to have the best balance between low
# linecount while making it simple to understand diffs
group_imports = "StdExternalCrate" group_imports = "StdExternalCrate"
imports_granularity = "Module" imports_granularity = "Module"
normalize_doc_attributes = true
wrap_comments = true format_macro_matchers = true