• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Rustfmt configuration
2# https://github.com/rust-lang/rustfmt/blob/HEAD/Configurations.md
3
4# This is required for bug-fixes, which technically can't be made to the stable
5# first version.
6# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3383).
7version = "Two"
8# Rustfmt cannot format long lines inside macros, but this option detects this.
9# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3391)
10error_on_line_overflow = true
11
12# Override the default formatting style.
13# See https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732/81.
14use_small_heuristics = "Max"
15# See https://github.com/rust-dev-tools/fmt-rfcs/issues/149.
16# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3370)
17overflow_delimited_expr = true
18
19# Apply rustfmt to more places.
20# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3362).
21merge_imports = true
22# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3348).
23format_code_in_doc_comments = true
24
25# Automatically fix deprecated style.
26use_field_init_shorthand = true
27use_try_shorthand = true
28
29# Set the default settings again to always apply the proper formatting without
30# being affected by the editor settings.
31edition = "2018"
32hard_tabs = false
33newline_style = "Unix"
34tab_spaces = 4
35