]> git.lizzy.rs Git - rust.git/blobdiff - Configurations.md
Put imports list on the next line if it exceeds max width
[rust.git] / Configurations.md
index 324546f5a0d58a4c5d5ea903e28f11256c91d45c..13c7acaed4f141f3266b9167710fa7d7d1263189 100644 (file)
@@ -1297,28 +1297,28 @@ Reorder import statements in group
 
 **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).
@@ -1360,7 +1360,11 @@ Reorder `extern crate` statements in group
 - **Possible values**: `true`, `false`
 - **Stable**: No
 
-#### `true` (default):
+#### `false` (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`.
 
@@ -1374,10 +1378,6 @@ extern crate lorem;
 extern crate sit;
 ```
 
-#### `false`:
-
-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.
-
 ## `reorder_modules`
 
 Reorder `mod` declarations alphabetically in group.
@@ -1386,7 +1386,7 @@ Reorder `mod` declarations alphabetically in group.
 - **Possible values**: `true`, `false`
 - **Stable**: No
 
-#### `true`
+#### `true` (default)
 
 ```rust
 mod a;
@@ -1688,7 +1688,8 @@ Number of spaces per tab
 fn lorem() {
     let ipsum = dolor();
     let sit = vec![
-        "amet consectetur adipiscing elit amet consectetur adipiscing elit amet consectetur.",
+        "amet consectetur adipiscing elit amet",
+        "consectetur adipiscing elit amet consectetur.",
     ];
 }
 ```
@@ -1699,7 +1700,8 @@ fn lorem() {
 fn lorem() {
   let ipsum = dolor();
   let sit = vec![
-    "amet consectetur adipiscing elit amet consectetur adipiscing elit amet consectetur.",
+    "amet consectetur adipiscing elit amet",
+    "consectetur adipiscing elit amet consectetur.",
   ];
 }
 ```
@@ -2110,8 +2112,55 @@ Whether to use colored output or not.
 
 ## `unstable_features`
 
-Enable unstable featuers on stable channel.
+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",
+]
+```