Each configuration option is either stable or unstable.
Stable options can be used directly, while unstable options are opt-in.
-To enable unstable options, set `unstable_features = true` in `rustfmt.toml` or pass `--unstable-options` to rustfmt.
+To enable unstable options, set `unstable_features = true` in `rustfmt.toml` or pass `--unstable-features` to rustfmt.
# Configuration Options
#### `"Block"` (default):
```rust
-let lorem = vec![
- "ipsum",
- "dolor",
- "sit",
- "amet",
- "consectetur",
- "adipiscing",
- "elit",
-];
+fn main() {
+ let lorem = vec![
+ "ipsum",
+ "dolor",
+ "sit",
+ "amet",
+ "consectetur",
+ "adipiscing",
+ "elit",
+ ];
+}
```
#### `"Visual"`:
```rust
-let lorem = vec!["ipsum",
- "dolor",
- "sit",
- "amet",
- "consectetur",
- "adipiscing",
- "elit"];
+fn main() {
+ let lorem = vec!["ipsum",
+ "dolor",
+ "sit",
+ "amet",
+ "consectetur",
+ "adipiscing",
+ "elit"];
+}
```
### Control flow
#### `"Block"` (default):
```rust
-if lorem_ipsum &&
- dolor_sit &&
- amet_consectetur
-{
- // ...
+fn main() {
+ if lorem_ipsum && dolor_sit && amet_consectetur && lorem_sit && dolor_consectetur && amet_ipsum
+ && lorem_consectetur
+ {
+ // ...
+ }
}
```
#### `"Visual"`:
```rust
-if lorem_ipsum &&
- dolor_sit &&
- amet_consectetur {
- // ...
+fn main() {
+ if lorem_ipsum && dolor_sit && amet_consectetur && lorem_sit && dolor_consectetur && amet_ipsum
+ && lorem_consectetur
+ {
+ // ...
+ }
}
```
#### `"Block"` (default):
```rust
-lorem(
- "lorem",
- "ipsum",
- "dolor",
- "sit",
- "amet",
- "consectetur",
- "adipiscing",
- "elit",
-);
+fn main() {
+ lorem(
+ "lorem",
+ "ipsum",
+ "dolor",
+ "sit",
+ "amet",
+ "consectetur",
+ "adipiscing",
+ "elit",
+ );
+}
```
#### `"Visual"`:
```rust
-lorem("lorem",
- "ipsum",
- "dolor",
- "sit",
- "amet",
- "consectetur",
- "adipiscing",
- "elit");
+fn main() {
+ lorem("lorem",
+ "ipsum",
+ "dolor",
+ "sit",
+ "amet",
+ "consectetur",
+ "adipiscing",
+ "elit");
+}
```
### Generics
Amet: Eq = usize,
Adipiscing: Eq = usize,
Consectetur: Eq = usize,
- Elit: Eq = usize
+ Elit: Eq = usize,
>(
ipsum: Ipsum,
dolor: Dolor,
Amet: Eq = usize,
Adipiscing: Eq = usize,
Consectetur: Eq = usize,
- Elit: Eq = usize>
- (ipsum: Ipsum,
- dolor: Dolor,
- sit: Sit,
- amet: Amet,
- adipiscing: Adipiscing,
- consectetur: Consectetur,
- elit: Elit)
- -> T {
+ Elit: Eq = usize>(
+ ipsum: Ipsum,
+ dolor: Dolor,
+ sit: Sit,
+ amet: Amet,
+ adipiscing: Adipiscing,
+ consectetur: Consectetur,
+ elit: Elit)
+ -> T {
// body
}
```
#### `"Block"` (default):
```rust
-let lorem = Lorem {
- ipsum: dolor,
- sit: amet,
-};
+fn main() {
+ let lorem = Lorem {
+ ipsum: dolor,
+ sit: amet,
+ };
+}
```
#### `"Visual"`:
```rust
-let lorem = Lorem { ipsum: dolor,
- sit: amet, };
+fn main() {
+ let lorem = Lorem { ipsum: dolor,
+ sit: amet, };
+}
```
See also: [`struct_lit_single_line`](#struct_lit_single_line), [`indent_style`](#indent_style).
Ipsum: Eq,
Dolor: Eq,
Sit: Eq,
- Amet: Eq
+ Amet: Eq,
{
// body
}
"adipiscing",
);
- let lorem = Lorem { ipsum: dolor, sit: amet };
+ let lorem = Lorem {
+ ipsum: dolor,
+ sit: amet,
+ };
+ let lorem = Lorem { ipsum: dolor };
let lorem = if ipsum { dolor } else { sit };
}
#### `"Front"` (default):
```rust
-let or = foo
- || bar
- || foobar;
+fn main() {
+ let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo
+ || barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
-let sum = 1234
- + 5678
- + 910;
+ let sum = 123456789012345678901234567890 + 123456789012345678901234567890
+ + 123456789012345678901234567890;
-let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- ..bbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
+ let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ ..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
+}
```
#### `"Back"`:
#### `false` (default):
```rust
-let (lorem, ipsum, _, _) = (1, 2, 3, 4);
+fn main() {
+ let (lorem, ipsum, _, _) = (1, 2, 3, 4);
+ let (lorem, ipsum, ..) = (1, 2, 3, 4);
+}
```
#### `true`:
```rust
-let (lorem, ipsum, ..) = (1, 2, 3, 4);
+fn main() {
+ let (lorem, ipsum, ..) = (1, 2, 3, 4);
+}
```
## `control_brace_style`
#### `"AlwaysSameLine"` (default):
```rust
-if lorem {
- println!("ipsum!");
-} else {
- println!("dolor!");
+fn main() {
+ if lorem {
+ println!("ipsum!");
+ } else {
+ println!("dolor!");
+ }
}
```
#### `"AlwaysNextLine"`:
```rust
-if lorem
-{
- println!("ipsum!");
-}
-else
-{
- println!("dolor!");
+fn main() {
+ if lorem
+ {
+ println!("ipsum!");
+ }
+ else
+ {
+ println!("dolor!");
+ }
}
```
#### `"ClosingNextLine"`:
```rust
-if lorem {
- println!("ipsum!");
-}
-else {
- println!("dolor!");
+fn main() {
+ if lorem {
+ println!("ipsum!");
+ }
+ else {
+ println!("dolor!");
+ }
}
```
## `error_on_line_overflow`
-Error if unable to get all lines within `max_width`
+Error if unable to get all lines within `max_width`, except for comments and string literals.
- **Default value**: `true`
- **Possible values**: `true`, `false`
See also [`max_width`](#max_width).
-## `error_on_line_overflow_comments`
+## `error_on_unformatted`
-Error if unable to get all comment lines within `comment_width`.
+Error if unable to get comments or string literals within `max_width`, or they are left with
+trailing whitespaces.
-- **Default value**: `true`
+- **Default value**: `false`
- **Possible values**: `true`, `false`
- **Stable**: No
-See also [`comment_width`](#comment_width).
-
## `fn_args_density`
Argument density in functions
```rust
trait Lorem {
- fn lorem(ipsum: Ipsum,
- dolor: Dolor,
- sit: Sit,
- amet: Amet);
-
- fn lorem(ipsum: Ipsum,
- dolor: Dolor,
- sit: Sit,
- amet: Amet) {
+ fn lorem(
+ ipsum: Ipsum,
+ dolor: Dolor,
+ sit: Sit,
+ amet: Amet,
+ );
+
+ fn lorem(
+ ipsum: Ipsum,
+ dolor: Dolor,
+ sit: Sit,
+ amet: Amet,
+ ) {
// body
}
- fn lorem(ipsum: Ipsum,
- dolor: Dolor,
- sit: Sit,
- amet: Amet,
- consectetur: Consectetur,
- adipiscing: Adipiscing,
- elit: Elit);
-
- fn lorem(ipsum: Ipsum,
- dolor: Dolor,
- sit: Sit,
- amet: Amet,
- consectetur: Consectetur,
- adipiscing: Adipiscing,
- elit: Elit) {
+ fn lorem(
+ ipsum: Ipsum,
+ dolor: Dolor,
+ sit: Sit,
+ amet: Amet,
+ consectetur: Consectetur,
+ adipiscing: Adipiscing,
+ elit: Elit,
+ );
+
+ fn lorem(
+ ipsum: Ipsum,
+ dolor: Dolor,
+ sit: Sit,
+ amet: Amet,
+ consectetur: Consectetur,
+ adipiscing: Adipiscing,
+ elit: Elit,
+ ) {
// body
}
}
}
struct Dolor<T>
- where T: Eq
+where
+ T: Eq,
{
sit: T,
}
}
struct Dolor<T>
- where T: Eq
+where
+ T: Eq,
{
sit: T,
}
}
struct Dolor<T>
- where T: Eq {
+where
+ T: Eq, {
sit: T,
}
```
where
Option<T>: Ipsum,
{
- ...
+ // body
}
```
```rust
impl<T> Lorem for T
-where Option<T>: Ipsum {
- ...
+where Option<T>: Ipsum
+{
+ // body
}
```
#### `false` (default):
```rust
-let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
+fn main() {
+ let lorem =
+ "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing";
+}
```
#### `true`:
```rust
-let lorem =
- "ipsum dolor sit amet consectetur \
- adipiscing elit lorem ipsum dolor sit";
+fn main() {
+ let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet \
+ consectetur adipiscing";
+}
```
See also [`max_width`](#max_width).
#### `"Visual"` (default):
```rust
-use foo::{xxx,
- yyy,
- zzz};
+use foo::{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
+ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz};
```
#### `"Block"`:
```rust
use foo::{
- xxx,
- yyy,
- zzz,
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
+ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz,
};
```
#### `"Mixed"` (default):
```rust
-use foo::{xxx, yyy, zzz};
+use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
-use foo::{aaa, bbb, ccc,
- ddd, eee, fff};
+use foo::{aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbb, cccccccccccccccccc, dddddddddddddddddd,
+ eeeeeeeeeeeeeeeeee, ffffffffffffffffff};
```
#### `"Horizontal"`:
#### `"HorizontalVertical"`:
```rust
-use foo::{xxx, yyy, zzz};
+use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
-use foo::{aaa,
- bbb,
- ccc,
- ddd,
- eee,
- fff};
+use foo::{aaaaaaaaaaaaaaaaaa,
+ bbbbbbbbbbbbbbbbbb,
+ cccccccccccccccccc,
+ dddddddddddddddddd,
+ eeeeeeeeeeeeeeeeee,
+ ffffffffffffffffff};
```
#### `"Vertical"`:
#### `false` (default):
```rust
-match lorem {
- Lorem::Ipsum => {
- println!("ipsum");
+fn main() {
+ match lorem {
+ Lorem::Ipsum => {
+ println!("ipsum");
+ }
+ Lorem::Dolor => println!("dolor"),
}
- Lorem::Dolor => println!("dolor"),
}
```
#### `true`:
```rust
-match lorem {
- Lorem::Ipsum => {
- println!("ipsum");
- },
- Lorem::Dolor => println!("dolor"),
+fn main() {
+ match lorem {
+ Lorem::Ipsum => {
+ println!("ipsum");
+ },
+ Lorem::Dolor => println!("dolor"),
+ }
}
```
#### `false` (default):
```rust
-result.and_then(|maybe_value| match maybe_value {
- None => ...,
- Some(value) => ...,
-})
+fn main() {
+ result.and_then(|maybe_value| match maybe_value {
+ None => foo(),
+ Some(value) => bar(),
+ });
-match lorem {
- None => if ipsum {
- println!("Hello World");
- },
- Some(dolor) => ...,
+ match lorem {
+ None => if ipsum {
+ println!("Hello World");
+ },
+ Some(dolor) => foo(),
+ }
}
```
#### `true`:
```rust
+fn main() {
+ result.and_then(|maybe_value| {
+ match maybe_value {
+ None => foo(),
+ Some(value) => bar(),
+ }
+ });
-result.and_then(|maybe_value| {
- match maybe_value {
- None => ...,
- Some(value) => ...,
- }
-})
-
-match lorem {
- None => {
- if ipsum {
- println!("Hello World");
+ match lorem {
+ None => {
+ if ipsum {
+ println!("Hello World");
+ }
}
+ Some(dolor) => foo(),
}
- Some(dolor) => ...,
}
```
**Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
-#### `false` (default):
+#### `true` (default):
```rust
-use std::mem;
use std::io;
+use std::mem;
-use lorem;
-use ipsum;
use dolor;
+use ipsum;
+use lorem;
use sit;
```
-#### `true`:
+#### `false`:
-```rust
-use std::io;
-use std::mem;
+```rust
use dolor;
use ipsum;
use lorem;
use sit;
+use std::io;
+use std::mem;
```
See also [`reorder_imports`](#reorder_imports).
```rust
extern crate lorem;
extern crate ipsum;
+
extern crate dolor;
extern crate sit;
```
- **Possible values**: `true`, `false`
- **Stable**: No
-**Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
+#### `false` (default):
-#### `true` (default):
+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.
+
+#### `true`:
+
+**Note:** This only takes effect when [`reorder_extern_crates`](#reorder_extern_crates) is set to `true`.
```rust
extern crate a;
extern crate sit;
```
-#### `false`:
+## `reorder_modules`
+
+Reorder `mod` declarations alphabetically in group.
+
+- **Default value**: `true`
+- **Possible values**: `true`, `false`
+- **Stable**: No
+
+#### `true` (default)
```rust
-extern crate b;
-extern crate a;
+mod a;
+mod b;
-extern crate lorem;
-extern crate ipsum;
-extern crate dolor;
-extern crate sit;
+mod dolor;
+mod ipsum;
+mod lorem;
+mod sit;
+```
+
+#### `false`
+
+```rust
+mod b;
+mod a;
+
+mod lorem;
+mod ipsum;
+mod dolor;
+mod sit;
```
-See also [`reorder_extern_crates`](#reorder_extern_crates).
+**Note** `mod` with `#[macro_export]` will not be reordered since that could change the semantic
+of the original source code.
## `report_todo`
## `spaces_around_ranges`
-Put spaces around the .. and ... range operators
+Put spaces around the .., ..=, and ... range operators
- **Default value**: `false`
- **Possible values**: `true`, `false`
#### `false` (default):
```rust
-let lorem = 0..10;
+fn main() {
+ let lorem = 0..10;
+ let ipsum = 0..=10;
+
+ match lorem {
+ 1..5 => foo(),
+ _ => bar,
+ }
+
+ match lorem {
+ 1..=5 => foo(),
+ _ => bar,
+ }
+
+ match lorem {
+ 1...5 => foo(),
+ _ => bar,
+ }
+}
```
#### `true`:
```rust
-let lorem = 0 .. 10;
+fn main() {
+ let lorem = 0 .. 10;
+ let ipsum = 0 ..= 10;
+
+ match lorem {
+ 1 .. 5 => foo(),
+ _ => bar,
+ }
+
+ match lorem {
+ 1 ..= 5 => foo(),
+ _ => bar,
+ }
+
+ match lorem {
+ 1 ... 5 => foo(),
+ _ => bar,
+ }
+}
```
## `spaces_within_parens_and_brackets`
}
// non-empty square brackets
-let lorem: [usize; 2] = [ipsum, dolor];
+fn lorem<T: Eq>(t: T) {
+ let lorem: [usize; 2] = [ipsum, dolor];
+}
```
#### `true`:
```rust
// generic arguments
-fn lorem< T: Eq >(t: T) {
+fn lorem< T: Eq >( t: T ) {
// body
}
// non-empty parentheses
-fn lorem<T: Eq>( t: T ) {
+fn lorem< T: Eq >( t: T ) {
let lorem = ( ipsum, dolor );
}
// non-empty square brackets
-let lorem: [ usize; 2 ] = [ ipsum, dolor ];
+fn lorem< T: Eq >( t: T ) {
+ let lorem: [ usize; 2 ] = [ ipsum, dolor ];
+}
```
## `struct_lit_single_line`
#### `true` (default):
```rust
-let lorem = Lorem { ipsum: dolor, sit: amet };
+fn main() {
+ let lorem = Lorem { foo: bar, baz: ofo };
+}
```
#### `false`:
```rust
-let lorem = Lorem {
- ipsum: dolor,
- sit: amet,
-};
+fn main() {
+ let lorem = Lorem {
+ foo: bar,
+ baz: ofo,
+ };
+}
```
See also: [`indent_style`](#indent_style).
fn lorem() {
let ipsum = dolor();
let sit = vec![
- "amet consectetur adipiscing elit."
+ "amet consectetur adipiscing elit amet consectetur adipiscing elit amet consectetur.",
];
}
```
fn lorem() {
let ipsum = dolor();
let sit = vec![
- "amet consectetur adipiscing elit."
+ "amet consectetur adipiscing elit amet consectetur adipiscing elit amet consectetur.",
];
}
```
#### `"Vertical"` (default):
```rust
-let Lorem { ipsum, dolor, sit } = amet;
-let Lorem {
- ipsum,
- dolor,
- sit,
- amet,
- consectetur,
- adipiscing,
-} = elit;
+fn main() {
+ let Lorem { ipsum, dolor, sit } = amet;
+ let Lorem {
+ ipsum,
+ dolor,
+ sit,
+ amet,
+ consectetur,
+ adipiscing,
+ } = elit;
+}
```
#### `"Always"`:
```rust
-let Lorem { ipsum, dolor, sit, } = amet;
-let Lorem {
- ipsum,
- dolor,
- sit,
- amet,
- consectetur,
- adipiscing,
-} = elit;
+fn main() {
+ let Lorem { ipsum, dolor, sit, } = amet;
+ let Lorem {
+ ipsum,
+ dolor,
+ sit,
+ amet,
+ consectetur,
+ adipiscing,
+ } = elit;
+}
```
#### `"Never"`:
```rust
-let Lorem { ipsum, dolor, sit } = amet;
-let Lorem {
- ipsum,
- dolor,
- sit,
- amet,
- consectetur,
- adipiscing
-} = elit;
+fn main() {
+ let Lorem { ipsum, dolor, sit } = amet;
+ let Lorem {
+ ipsum,
+ dolor,
+ sit,
+ amet,
+ consectetur,
+ adipiscing
+ } = elit;
+}
```
See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
```rust
fn lorem<Ipsum: Dolor + Sit = Amet>() {
- // body
+ // body
}
```
```rust
fn lorem<Ipsum: Dolor+Sit=Amet>() {
- // body
+ // body
+}
+```
+
+## `use_field_init_shorthand`
+
+Use field initialize shorthand if possible.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: No
+
+#### `false` (default):
+
+```rust
+struct Foo {
+ x: u32,
+ y: u32,
+ z: u32,
+}
+
+fn main() {
+ let x = 1;
+ let y = 2;
+ let z = 3;
+ let a = Foo { x: x, y: y, z: z };
+}
+```
+
+#### `true`:
+
+```rust
+struct Foo {
+ x: u32,
+ y: u32,
+ z: u32,
+}
+
+fn main() {
+ let x = 1;
+ let y = 2;
+ let z = 3;
+ let a = Foo { x, y, z };
}
```
#### `false` (default):
```rust
-let lorem = try!(ipsum.map(|dolor|dolor.sit()));
+fn main() {
+ let lorem = try!(ipsum.map(|dolor| dolor.sit()));
+}
```
#### `true`:
```rust
-let lorem = ipsum.map(|dolor| dolor.sit())?;
+fn main() {
+ let lorem = ipsum.map(|dolor| dolor.sit())?;
+}
```
#### `true` (default):
```rust
-match lorem {
- true => {
- foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
+fn main() {
+ match lorem {
+ true => {
+ foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
+ }
+ false => println!("{}", sit),
}
- false => println!("{}", sit),
}
```
#### `false`:
```rust
-match lorem {
- true =>
- foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
- false => println!("{}", sit),
+fn main() {
+ match lorem {
+ true =>
+ foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
+ false => println!("{}", sit),
+ }
}
```
What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
- **Default value**: `"Overwrite"`
-- **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`, `"Modified"`
+- **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`
- **Stable**: No
## `blank_lines_upper_bound`
Original Code:
```rust
+#![rustfmt_skip]
+
fn foo() {
println!("a");
}
Original Code (rustfmt will not change it with the default value of `0`):
```rust
+#![rustfmt_skip]
+
fn foo() {
println!("a");
}
println!("c");
}
```
+
+## `remove_blank_lines_at_start_or_end_of_block`
+
+Remove blank lines at the start or the end of a block.
+
+- **Default value**: `true`
+- **Possible values**: `true`, `false`
+- **Stable**: No
+
+#### `true`
+
+```rust
+fn foo() {
+ let msg = {
+ let mut str = String::new();
+ str.push_str("hello, ");
+ str.push_str("world!");
+ str
+ };
+ println!("{}", msg);
+}
+```
+
+#### `false`
+
+```rust
+fn foo() {
+
+ let msg = {
+
+ let mut str = String::new();
+ str.push_str("hello, ");
+ str.push_str("world!");
+ str
+
+ };
+ println!("{}", msg);
+
+}
+```
+
+## `required_version`
+
+Require a specific version of rustfmt. If you want to make sure that the
+specific version of rustfmt is used in your CI, use this option.
+
+- **Default value**: `CARGO_PKG_VERSION`
+- **Possible values**: any published version (e.g. `"0.3.8"`)
+- **Stable**: No
+
+## `hide_parse_errors`
+
+Do not show parse errors if the parser failed to parse files.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: No
+
+## `color`
+
+Whether to use colored output or not.
+
+- **Default value**: `"Auto"`
+- **Possible values**: "Auto", "Always", "Never"
+- **Stable**: No
+
+## `unstable_features`
+
+Enable unstable features on stable channel.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: Yes
+
+## `license_template_path`
+
+Check whether beginnings of files match a license template.
+
+- **Default value**: `""``
+- **Possible values**: path to a license template file
+- **Stable**: No
+
+A license template is a plain text file which is matched literally against the
+beginning of each source file, except for `{}`-delimited blocks, which are
+matched as regular expressions. The following license template therefore
+matches strings like `// Copyright 2017 The Rust Project Developers.`, `//
+Copyright 2018 The Rust Project Developers.`, etc.:
+
+```
+// Copyright {\d+} The Rust Project Developers.
+```
+
+`\{`, `\}` and `\\` match literal braces / backslashes.
+
+## `ignore`
+
+Skip formatting the specified files and directories.
+
+- **Default value**: format every files
+- **Possible values**: See an example below
+- **Stable**: No
+
+### Example
+
+If you want to ignore specific files, put the following to your config file:
+
+```toml
+ignore = [
+ "src/types.rs",
+ "src/foo/bar.rs",
+]
+```
+
+If you want to ignore every file under `examples/`, put the following to your config file:
+
+```toml
+ignore [
+ "examples",
+]
+```