-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrustfmt.toml
More file actions
42 lines (35 loc) · 1.8 KB
/
Copy pathrustfmt.toml
File metadata and controls
42 lines (35 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Workspace rustfmt config for the PIM sync engine.
#
# It is deliberately as strict as rustfmt allows, which means several options here are
# **nightly-only** — so formatting runs on nightly: `cargo +nightly fmt`. A plain stable
# `cargo build`/`test` is unaffected (formatting is a separate step); CI runs the fmt check on
# a pinned nightly (see `.github/workflows/ci.yml`) so its output is reproducible against what
# you run locally.
# Opt into the 2024 formatting-style rules (the newest, strictest defaults).
style_edition = "2024"
# Width budget. Kept at the rustfmt default so diffs stay conventional.
max_width = 100
# Imports: collapse to one `use` per crate, grouped std / external / crate and alphabetized,
# so import blocks are uniform across every file.
imports_granularity = "Crate"
group_imports = "StdExternalCrate"
# Comments & docs: wrap prose to the width budget, format fenced code inside doc comments,
# and normalize `/* … */` to `//` and doc attributes to `///` so comment style is uniform.
wrap_comments = true
comment_width = 100
format_code_in_doc_comments = true
normalize_comments = true
normalize_doc_attributes = true
# Small, unambiguous consistency wins.
use_field_init_shorthand = true
use_try_shorthand = true
condense_wildcard_suffixes = true
format_macro_matchers = true
reorder_impl_items = true
newline_style = "Unix"
# Strictness: an over-long line of *code* is a hard fmt error (fails `cargo fmt --check`)
# rather than being quietly left as-is. `error_on_unformatted` (the comment/string-literal
# variant) is deliberately left OFF: some doc comments carry unbreakable URLs and a few tests
# hold long raw-string fixtures that cannot be wrapped — those are legitimately unformattable,
# and erroring on them would only punish unavoidable long strings.
error_on_line_overflow = true