Files
pnpm/rustfmt.toml
T
Zoltan Kochan 2ea04e6e52 style(rust): adopt complexity-aware rustfmt (#14875)
Pin pnpm's rustfmt fork and use a cached wrapper for local formatting,
CI, pre-push checks, and editor integration. The formatter has its own
dated nightly runtime while the workspace keeps its existing compiler.

Choose chain layout by call count and argument complexity, with a
40-column allowance for short expressions. Attach the first method when
the complete first line would otherwise end within the continuation
indentation. Preserve simple receivers,
cap intermediate leading accesses at column 80 and final accesses at
100, and separate fields and
await after wrapped methods. Apply the same rules in conditions.

Keep Max heuristics and compact struct literals, with an independent
35-column destructuring limit. Reformat pnpm and pnpr, extract only the
helpers and test modules needed for existing size limits, and fix macro
commas without relaxing lint rules.

Related to pnpm/pnpm#14562 and pnpm/pnpm#14862.
2026-09-13 22:39:50 +02:00

22 lines
670 B
TOML

# Make Rust more readable given most people have wide screens nowadays.
# This is also the setting used by [rustc](https://github.com/rust-lang/rust/blob/c7fe5e9d1e/rustfmt.toml)
use_small_heuristics = "Max"
chain_complexity_layout = true
chain_width = 40
chain_head_width = 80
struct_pattern_width = 35
# Use field initialize shorthand if possible
use_field_init_shorthand = true
# All unstable features that we wish for
# unstable_features = true
# version = "Two"
# Provide a cleaner impl order
# reorder_impl_items = true
# Provide a cleaner import sort order
# group_imports = "StdExternalCrate"
# Group "use" statements by crate
# imports_granularity = "Crate"