3 Rustfmt is designed to be very configurable. You can create a TOML file called `rustfmt.toml` or `.rustfmt.toml`, place it in the project or any other parent directory and it will apply the options in that file.
5 A possible content of `rustfmt.toml` or `.rustfmt.toml` might look like this:
9 reorder_imported_names = true
12 Each configuration option is either stable or unstable.
13 Stable options can be used directly, while unstable options are opt-in.
14 To enable unstable options, set `unstable_features = true` in `rustfmt.toml` or pass `--unstable-features` to rustfmt.
16 # Configuration Options
18 Below you find a detailed visual guide on all the supported configuration options of rustfmt:
23 Indent on expressions or items.
25 - **Default value**: `"Block"`
26 - **Possible values**: `"Block"`, `"Visual"`
31 #### `"Block"` (default):
51 let lorem = vec!["ipsum",
63 #### `"Block"` (default):
67 if lorem_ipsum && dolor_sit && amet_consectetur && lorem_sit && dolor_consectetur && amet_ipsum
79 if lorem_ipsum && dolor_sit && amet_consectetur && lorem_sit && dolor_consectetur && amet_ipsum
87 See also: [`control_brace_style`](#control_brace_style).
89 ### Function arguments
91 #### `"Block"` (default):
96 fn lorem(ipsum: usize) {}
116 fn lorem(ipsum: usize) {}
118 fn lorem(ipsum: usize,
131 #### `"Block"` (default):
165 #### `"Block"` (default):
173 Adipiscing: Eq = usize,
174 Consectetur: Eq = usize,
181 adipiscing: Adipiscing,
182 consectetur: Consectetur,
192 fn lorem<Ipsum: Eq = usize,
196 Adipiscing: Eq = usize,
197 Consectetur: Eq = usize,
203 adipiscing: Adipiscing,
204 consectetur: Consectetur,
213 #### `"Block"` (default):
228 let lorem = Lorem { ipsum: dolor,
233 See also: [`struct_lit_single_line`](#struct_lit_single_line), [`indent_style`](#indent_style).
237 #### `"Block"` (default):
240 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
254 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
264 ## `use_small_heuristics`
266 Whether to use different formatting for items and expressions if they satisfy a heuristic notion of 'small'.
268 - **Default value**: `true`
269 - **Possible values**: `true`, `false`
272 #### `true` (default):
278 Sit { amet: Consectetur, adipiscing: Elit },
296 let lorem = Lorem { ipsum: dolor };
298 let lorem = if ipsum { dolor } else { sit };
315 lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing");
322 let lorem = if ipsum {
332 Where to put a binary operator when a binary expression goes multiline.
334 - **Default value**: `"Front"`
335 - **Possible values**: `"Front"`, `"Back"`
338 #### `"Front"` (default):
342 let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo
343 || barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
345 let sum = 123456789012345678901234567890 + 123456789012345678901234567890
346 + 123456789012345678901234567890;
348 let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
349 ..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
357 let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo ||
358 barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
360 let sum = 123456789012345678901234567890 + 123456789012345678901234567890 +
361 123456789012345678901234567890;
363 let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..
364 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
368 ## `combine_control_expr`
370 Combine control expressions with function calls.
372 - **Default value**: `true`
373 - **Possible values**: `true`, `false`
376 #### `true` (default):
388 foo!(if let Some(..) = x {
401 foo!(while let Some(..) = x {
435 if let Some(..) = x {
452 while let Some(..) = x {
478 Maximum length of comments. No effect unless`wrap_comments = true`.
480 - **Default value**: `80`
481 - **Possible values**: any positive integer
484 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
486 #### `80` (default; comments shorter than `comment_width`):
488 // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
491 #### `60` (comments longer than `comment_width`):
493 // Lorem ipsum dolor sit amet,
494 // consectetur adipiscing elit.
497 See also [`wrap_comments`](#wrap_comments).
499 ## `condense_wildcard_suffixes`
501 Replace strings of _ wildcards by a single .. in tuple patterns
503 - **Default value**: `false`
504 - **Possible values**: `true`, `false`
507 #### `false` (default):
511 let (lorem, ipsum, _, _) = (1, 2, 3, 4);
512 let (lorem, ipsum, ..) = (1, 2, 3, 4);
520 let (lorem, ipsum, ..) = (1, 2, 3, 4);
524 ## `control_brace_style`
526 Brace style for control flow constructs
528 - **Default value**: `"AlwaysSameLine"`
529 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
532 #### `"AlwaysSameLine"` (default):
544 #### `"AlwaysNextLine"`:
559 #### `"ClosingNextLine"`:
572 ## `disable_all_formatting`
574 Don't reformat anything
576 - **Default value**: `false`
577 - **Possible values**: `true`, `false`
580 ## `error_on_line_overflow`
582 Error if unable to get all lines within `max_width`, except for comments and string literals.
584 - **Default value**: `true`
585 - **Possible values**: `true`, `false`
588 See also [`max_width`](#max_width).
590 ## `error_on_unformatted`
592 Error if unable to get comments or string literals within `max_width`, or they are left with
593 trailing whitespaces.
595 - **Default value**: `false`
596 - **Possible values**: `true`, `false`
601 Argument density in functions
603 - **Default value**: `"Tall"`
604 - **Possible values**: `"Compressed"`, `"Tall"`, `"Vertical"`
607 #### `"Tall"` (default):
611 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
613 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
622 consectetur: Consectetur,
623 adipiscing: Adipiscing,
632 consectetur: Consectetur,
633 adipiscing: Adipiscing,
645 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
647 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
652 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
653 adipiscing: Adipiscing, elit: Elit,
657 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
658 adipiscing: Adipiscing, elit: Elit,
690 consectetur: Consectetur,
691 adipiscing: Adipiscing,
700 consectetur: Consectetur,
701 adipiscing: Adipiscing,
712 Brace style for items
714 - **Default value**: `"SameLineWhere"`
715 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
720 #### `"SameLineWhere"` (default):
727 fn lorem(ipsum: usize) {
731 fn lorem<T>(ipsum: T)
733 T: Add + Sub + Mul + Div,
739 #### `"AlwaysNextLine"`:
747 fn lorem(ipsum: usize)
752 fn lorem<T>(ipsum: T)
754 T: Add + Sub + Mul + Div,
760 #### `"PreferSameLine"`:
767 fn lorem(ipsum: usize) {
771 fn lorem<T>(ipsum: T)
773 T: Add + Sub + Mul + Div, {
778 ### Structs and enums
780 #### `"SameLineWhere"` (default):
795 #### `"AlwaysNextLine"`:
811 #### `"PreferSameLine"`:
826 ## `empty_item_single_line`
828 Put empty-body functions and impls on a single line
830 - **Default value**: `true`
831 - **Possible values**: `true`, `false`
834 #### `true` (default):
852 See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_style).
857 Put single-expression functions on a single line
859 - **Default value**: `false`
860 - **Possible values**: `true`, `false`
863 #### `false` (default):
866 fn lorem() -> usize {
870 fn lorem() -> usize {
879 fn lorem() -> usize { 42 }
881 fn lorem() -> usize {
887 See also [`control_brace_style`](#control_brace_style).
890 ## `where_single_line`
892 Forces the `where` clause to be laid out on a single line.
894 - **Default value**: `false`
895 - **Possible values**: `true`, `false`
898 #### `false` (default):
913 where Option<T>: Ipsum
919 See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_style).
922 ## `force_explicit_abi`
924 Always print the abi for extern items
926 - **Default value**: `true`
927 - **Possible values**: `true`, `false`
930 **Note:** Non-"C" ABIs are always printed. If `false` then "C" is removed.
932 #### `true` (default):
936 pub static lorem: c_int;
944 pub static lorem: c_int;
950 Format string literals where necessary
952 - **Default value**: `false`
953 - **Possible values**: `true`, `false`
956 #### `false` (default):
961 "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing";
969 let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet \
970 consectetur adipiscing";
974 See also [`max_width`](#max_width).
978 Use tab characters for indentation, spaces for alignment
980 - **Default value**: `false`
981 - **Possible values**: `true`, `false`
984 #### `false` (default):
987 fn lorem() -> usize {
988 42 // spaces before 42
995 fn lorem() -> usize {
1000 See also: [`tab_spaces`](#tab_spaces).
1005 Indent style of imports
1007 - **Default Value**: `"Visual"`
1008 - **Possible values**: `"Block"`, `"Visual"`
1011 #### `"Visual"` (default):
1014 use foo::{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
1015 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz};
1022 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
1023 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz,
1027 See also: [`imports_layout`](#imports_layout).
1031 Item layout inside a imports block
1033 - **Default value**: "Mixed"
1034 - **Possible values**: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
1037 #### `"Mixed"` (default):
1040 use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
1042 use foo::{aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbb, cccccccccccccccccc, dddddddddddddddddd,
1043 eeeeeeeeeeeeeeeeee, ffffffffffffffffff};
1046 #### `"Horizontal"`:
1048 **Note**: This option forces all imports onto one line and may exceed `max_width`.
1051 use foo::{xxx, yyy, zzz};
1053 use foo::{aaa, bbb, ccc, ddd, eee, fff};
1056 #### `"HorizontalVertical"`:
1059 use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
1061 use foo::{aaaaaaaaaaaaaaaaaa,
1066 ffffffffffffffffff};
1085 ## `match_block_trailing_comma`
1087 Put a trailing comma after a block based match arm (non-block arms are not affected)
1089 - **Default value**: `false`
1090 - **Possible values**: `true`, `false`
1093 #### `false` (default):
1101 Lorem::Dolor => println!("dolor"),
1114 Lorem::Dolor => println!("dolor"),
1119 See also: [`trailing_comma`](#trailing_comma), [`match_arm_blocks`](#match_arm_blocks).
1123 Maximum width of each line
1125 - **Default value**: `100`
1126 - **Possible values**: any positive integer
1129 See also [`error_on_line_overflow`](#error_on_line_overflow).
1133 Merge multiple derives into a single one.
1135 - **Default value**: `true`
1136 - **Possible values**: `true`, `false`
1139 #### `true` (default):
1142 #[derive(Eq, PartialEq, Debug, Copy, Clone)]
1149 #[derive(Eq, PartialEq)]
1151 #[derive(Copy, Clone)]
1155 ## `force_multiline_blocks`
1157 Force multiline closure and match arm bodies to be wrapped in a block
1159 - **Default value**: `false`
1160 - **Possible values**: `false`, `true`
1163 #### `false` (default):
1167 result.and_then(|maybe_value| match maybe_value {
1169 Some(value) => bar(),
1174 println!("Hello World");
1176 Some(dolor) => foo(),
1185 result.and_then(|maybe_value| {
1188 Some(value) => bar(),
1195 println!("Hello World");
1198 Some(dolor) => foo(),
1206 Unix or Windows line endings
1208 - **Default value**: `"Unix"`
1209 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1212 ## `normalize_comments`
1214 Convert /* */ comments to // comments where possible
1216 - **Default value**: `false`
1217 - **Possible values**: `true`, `false`
1220 #### `false` (default):
1224 fn dolor() -> usize {}
1227 fn adipiscing() -> usize {}
1234 fn dolor() -> usize {}
1237 fn adipiscing() -> usize {}
1240 ## `reorder_imported_names`
1242 Reorder lists of names in import statements alphabetically
1244 - **Default value**: `false`
1245 - **Possible values**: `true`, `false`
1248 #### `false` (default):
1251 use super::{lorem, ipsum, dolor, sit};
1257 use super::{dolor, ipsum, lorem, sit};
1260 See also [`reorder_imports`](#reorder_imports).
1262 ## `reorder_imports`
1264 Reorder import statements alphabetically
1266 - **Default value**: `false`
1267 - **Possible values**: `true`, `false`
1270 #### `false` (default):
1288 See also [`reorder_imported_names`](#reorder_imported_names), [`reorder_imports_in_group`](#reorder_imports_in_group).
1290 ## `reorder_imports_in_group`
1292 Reorder import statements in group
1294 - **Default value**: `false`
1295 - **Possible values**: `true`, `false`
1298 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1300 #### `true` (default):
1324 See also [`reorder_imports`](#reorder_imports).
1326 ## `reorder_extern_crates`
1328 Reorder `extern crate` statements alphabetically
1330 - **Default value**: `true`
1331 - **Possible values**: `true`, `false`
1334 #### `true` (default):
1353 See also [`reorder_extern_crates_in_group`](#reorder_extern_crates_in_group).
1355 ## `reorder_extern_crates_in_group`
1357 Reorder `extern crate` statements in group
1359 - **Default value**: `true`
1360 - **Possible values**: `true`, `false`
1363 #### `false` (default):
1365 This value has no influence beyond the effect of the [`reorder_extern_crates`](#reorder_extern_crates) option. Set [`reorder_extern_crates`](#reorder_extern_crates) to `false` if you do not want `extern crate` groups to be collapsed and ordered.
1369 **Note:** This only takes effect when [`reorder_extern_crates`](#reorder_extern_crates) is set to `true`.
1381 ## `reorder_modules`
1383 Reorder `mod` declarations alphabetically in group.
1385 - **Default value**: `true`
1386 - **Possible values**: `true`, `false`
1389 #### `true` (default)
1413 **Note** `mod` with `#[macro_export]` will not be reordered since that could change the semantic
1414 of the original source code.
1416 ## `reorder_impl_items`
1418 Reorder impl items. `type` and `const` are put first, then macros and methods.
1420 - **Default value**: `false`
1421 - **Possible values**: `true`, `false`
1424 #### `false` (default)
1429 impl Iterator for Dummy {
1430 fn next(&mut self) -> Option<Self::Item> {
1443 impl Iterator for Dummy {
1446 fn next(&mut self) -> Option<Self::Item> {
1454 Report `TODO` items in comments.
1456 - **Default value**: `"Never"`
1457 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
1460 Warns about any comments containing `TODO` in them when set to `"Always"`. If
1461 it contains a `#X` (with `X` being a number) in parentheses following the
1462 `TODO`, `"Unnumbered"` will ignore it.
1464 See also [`report_fixme`](#report_fixme).
1468 Report `FIXME` items in comments.
1470 - **Default value**: `"Never"`
1471 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
1474 Warns about any comments containing `FIXME` in them when set to `"Always"`. If
1475 it contains a `#X` (with `X` being a number) in parentheses following the
1476 `FIXME`, `"Unnumbered"` will ignore it.
1478 See also [`report_todo`](#report_todo).
1483 Don't reformat out of line modules
1485 - **Default value**: `false`
1486 - **Possible values**: `true`, `false`
1489 ## `space_after_colon`
1491 Leave a space after the colon.
1493 - **Default value**: `true`
1494 - **Possible values**: `true`, `false`
1497 #### `true` (default):
1500 fn lorem<T: Eq>(t: T) {
1501 let lorem: Dolor = Lorem {
1511 fn lorem<T:Eq>(t:T) {
1512 let lorem:Dolor = Lorem {
1519 See also: [`space_before_colon`](#space_before_colon).
1521 ## `space_before_colon`
1523 Leave a space before the colon.
1525 - **Default value**: `false`
1526 - **Possible values**: `true`, `false`
1529 #### `false` (default):
1532 fn lorem<T: Eq>(t: T) {
1533 let lorem: Dolor = Lorem {
1543 fn lorem<T : Eq>(t : T) {
1544 let lorem : Dolor = Lorem {
1551 See also: [`space_after_colon`](#space_after_colon).
1553 ## `struct_field_align_threshold`
1555 The maximum diff of width between struct fields to be aligned with each other.
1557 - **Default value** : 0
1558 - **Possible values**: any positive integer
1581 ## `spaces_around_ranges`
1583 Put spaces around the .., ..=, and ... range operators
1585 - **Default value**: `false`
1586 - **Possible values**: `true`, `false`
1589 #### `false` (default):
1617 let lorem = 0 .. 10;
1618 let ipsum = 0 ..= 10;
1637 ## `spaces_within_parens_and_brackets`
1639 Put spaces within non-empty generic arguments, parentheses, and square brackets
1641 - **Default value**: `false`
1642 - **Possible values**: `true`, `false`
1645 #### `false` (default):
1648 // generic arguments
1649 fn lorem<T: Eq>(t: T) {
1653 // non-empty parentheses
1654 fn lorem<T: Eq>(t: T) {
1655 let lorem = (ipsum, dolor);
1658 // non-empty square brackets
1659 fn lorem<T: Eq>(t: T) {
1660 let lorem: [usize; 2] = [ipsum, dolor];
1667 // generic arguments
1668 fn lorem< T: Eq >( t: T ) {
1672 // non-empty parentheses
1673 fn lorem< T: Eq >( t: T ) {
1674 let lorem = ( ipsum, dolor );
1677 // non-empty square brackets
1678 fn lorem< T: Eq >( t: T ) {
1679 let lorem: [ usize; 2 ] = [ ipsum, dolor ];
1683 ## `struct_lit_single_line`
1685 Put small struct literals on a single line
1687 - **Default value**: `true`
1688 - **Possible values**: `true`, `false`
1691 #### `true` (default):
1695 let lorem = Lorem { foo: bar, baz: ofo };
1710 See also: [`indent_style`](#indent_style).
1715 Number of spaces per tab
1717 - **Default value**: `4`
1718 - **Possible values**: any positive integer
1725 let ipsum = dolor();
1727 "amet consectetur adipiscing elit amet",
1728 "consectetur adipiscing elit amet consectetur.",
1737 let ipsum = dolor();
1739 "amet consectetur adipiscing elit amet",
1740 "consectetur adipiscing elit amet consectetur.",
1745 See also: [`hard_tabs`](#hard_tabs).
1750 How to handle trailing commas for lists
1752 - **Default value**: `"Vertical"`
1753 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1756 #### `"Vertical"` (default):
1760 let Lorem { ipsum, dolor, sit } = amet;
1776 let Lorem { ipsum, dolor, sit, } = amet;
1792 let Lorem { ipsum, dolor, sit } = amet;
1804 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1806 ## `trailing_semicolon`
1808 Add trailing semicolon after break, continue and return
1810 - **Default value**: `true`
1811 - **Possible values**: `true`, `false`
1814 #### `true` (default):
1828 ## `type_punctuation_density`
1830 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1832 - **Default value**: `"Wide"`
1833 - **Possible values**: `"Compressed"`, `"Wide"`
1836 #### `"Wide"` (default):
1839 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1844 #### `"Compressed"`:
1847 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1852 ## `use_field_init_shorthand`
1854 Use field initialize shorthand if possible.
1856 - **Default value**: `false`
1857 - **Possible values**: `true`, `false`
1860 #### `false` (default):
1873 let a = Foo { x: x, y: y, z: z };
1890 let a = Foo { x, y, z };
1894 ## `use_try_shorthand`
1896 Replace uses of the try! macro by the ? shorthand
1898 - **Default value**: `false`
1899 - **Possible values**: `true`, `false`
1902 #### `false` (default):
1906 let lorem = try!(ipsum.map(|dolor| dolor.sit()));
1914 let lorem = ipsum.map(|dolor| dolor.sit())?;
1921 Break comments to fit on the line
1923 - **Default value**: `false`
1924 - **Possible values**: `true`, `false`
1927 #### `false` (default):
1930 // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
1936 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
1937 // sed do eiusmod tempor incididunt ut labore et dolore
1938 // magna aliqua. Ut enim ad minim veniam, quis nostrud
1939 // exercitation ullamco laboris nisi ut aliquip ex ea
1940 // commodo consequat.
1943 ## `match_arm_blocks`
1945 Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
1947 - **Default value**: `true`
1948 - **Possible values**: `true`, `false`
1951 #### `true` (default):
1957 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
1959 false => println!("{}", sit),
1970 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
1971 false => println!("{}", sit),
1976 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1980 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
1982 - **Default value**: `"Overwrite"`
1983 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`
1986 ## `blank_lines_upper_bound`
1988 Maximum number of blank lines which can be put between items. If more than this number of consecutive empty
1989 lines are found, they are trimmed down to match this integer.
1991 - **Default value**: `1`
1992 - **Possible values**: *unsigned integer*
2043 See also: [`blank_lines_lower_bound`](#blank_lines_lower_bound)
2045 ## `blank_lines_lower_bound`
2047 Minimum number of blank lines which must be put between items. If two items have fewer blank lines between
2048 them, additional blank lines are inserted.
2050 - **Default value**: `0`
2051 - **Possible values**: *unsigned integer*
2055 Original Code (rustfmt will not change it with the default value of `0`):
2084 ## `remove_blank_lines_at_start_or_end_of_block`
2086 Remove blank lines at the start or the end of a block.
2088 - **Default value**: `true`
2089 - **Possible values**: `true`, `false`
2097 let mut str = String::new();
2098 str.push_str("hello, ");
2099 str.push_str("world!");
2102 println!("{}", msg);
2113 let mut str = String::new();
2114 str.push_str("hello, ");
2115 str.push_str("world!");
2119 println!("{}", msg);
2124 ## `required_version`
2126 Require a specific version of rustfmt. If you want to make sure that the
2127 specific version of rustfmt is used in your CI, use this option.
2129 - **Default value**: `CARGO_PKG_VERSION`
2130 - **Possible values**: any published version (e.g. `"0.3.8"`)
2133 ## `hide_parse_errors`
2135 Do not show parse errors if the parser failed to parse files.
2137 - **Default value**: `false`
2138 - **Possible values**: `true`, `false`
2143 Whether to use colored output or not.
2145 - **Default value**: `"Auto"`
2146 - **Possible values**: "Auto", "Always", "Never"
2149 ## `unstable_features`
2151 Enable unstable features on stable channel.
2153 - **Default value**: `false`
2154 - **Possible values**: `true`, `false`
2157 ## `license_template_path`
2159 Check whether beginnings of files match a license template.
2161 - **Default value**: `""``
2162 - **Possible values**: path to a license template file
2165 A license template is a plain text file which is matched literally against the
2166 beginning of each source file, except for `{}`-delimited blocks, which are
2167 matched as regular expressions. The following license template therefore
2168 matches strings like `// Copyright 2017 The Rust Project Developers.`, `//
2169 Copyright 2018 The Rust Project Developers.`, etc.:
2172 // Copyright {\d+} The Rust Project Developers.
2175 `\{`, `\}` and `\\` match literal braces / backslashes.
2179 Skip formatting the specified files and directories.
2181 - **Default value**: format every files
2182 - **Possible values**: See an example below
2187 If you want to ignore specific files, put the following to your config file:
2196 If you want to ignore every file under `examples/`, put the following to your config file: