]> git.lizzy.rs Git - rust.git/blob - Configurations.md
428cdfd85164d7391bf67234c1836b1f8369da0e
[rust.git] / Configurations.md
1 # Configuring Rustfmt
2
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.
4
5 A possible content of `rustfmt.toml` or `.rustfmt.toml` might look like this:
6
7 ```toml
8 indent_style = "Block"
9 reorder_imports = false
10 ```
11
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.
15
16 # Configuration Options
17
18 Below you find a detailed visual guide on all the supported configuration options of rustfmt:
19
20
21 ## `indent_style`
22
23 Indent on expressions or items.
24
25 - **Default value**: `"Block"`
26 - **Possible values**: `"Block"`, `"Visual"`
27 - **Stable**: No
28
29 ### Array
30
31 #### `"Block"` (default):
32
33 ```rust
34 fn main() {
35     let lorem = vec![
36         "ipsum",
37         "dolor",
38         "sit",
39         "amet",
40         "consectetur",
41         "adipiscing",
42         "elit",
43     ];
44 }
45 ```
46
47 #### `"Visual"`:
48
49 ```rust
50 fn main() {
51     let lorem = vec!["ipsum",
52                      "dolor",
53                      "sit",
54                      "amet",
55                      "consectetur",
56                      "adipiscing",
57                      "elit"];
58 }
59 ```
60
61 ### Control flow
62
63 #### `"Block"` (default):
64
65 ```rust
66 fn main() {
67     if lorem_ipsum && dolor_sit && amet_consectetur && lorem_sit && dolor_consectetur && amet_ipsum
68         && lorem_consectetur
69     {
70         // ...
71     }
72 }
73 ```
74
75 #### `"Visual"`:
76
77 ```rust
78 fn main() {
79     if lorem_ipsum && dolor_sit && amet_consectetur && lorem_sit && dolor_consectetur && amet_ipsum
80        && lorem_consectetur
81     {
82         // ...
83     }
84 }
85 ```
86
87 See also: [`control_brace_style`](#control_brace_style).
88
89 ### Function arguments
90
91 #### `"Block"` (default):
92
93 ```rust
94 fn lorem() {}
95
96 fn lorem(ipsum: usize) {}
97
98 fn lorem(
99     ipsum: usize,
100     dolor: usize,
101     sit: usize,
102     amet: usize,
103     consectetur: usize,
104     adipiscing: usize,
105     elit: usize,
106 ) {
107     // body
108 }
109 ```
110
111 #### `"Visual"`:
112
113 ```rust
114 fn lorem() {}
115
116 fn lorem(ipsum: usize) {}
117
118 fn lorem(ipsum: usize,
119          dolor: usize,
120          sit: usize,
121          amet: usize,
122          consectetur: usize,
123          adipiscing: usize,
124          elit: usize) {
125     // body
126 }
127 ```
128
129 ### Function calls
130
131 #### `"Block"` (default):
132
133 ```rust
134 fn main() {
135     lorem(
136         "lorem",
137         "ipsum",
138         "dolor",
139         "sit",
140         "amet",
141         "consectetur",
142         "adipiscing",
143         "elit",
144     );
145 }
146 ```
147
148 #### `"Visual"`:
149
150 ```rust
151 fn main() {
152     lorem("lorem",
153           "ipsum",
154           "dolor",
155           "sit",
156           "amet",
157           "consectetur",
158           "adipiscing",
159           "elit");
160 }
161 ```
162
163 ### Generics
164
165 #### `"Block"` (default):
166
167 ```rust
168 fn lorem<
169     Ipsum: Eq = usize,
170     Dolor: Eq = usize,
171     Sit: Eq = usize,
172     Amet: Eq = usize,
173     Adipiscing: Eq = usize,
174     Consectetur: Eq = usize,
175     Elit: Eq = usize,
176 >(
177     ipsum: Ipsum,
178     dolor: Dolor,
179     sit: Sit,
180     amet: Amet,
181     adipiscing: Adipiscing,
182     consectetur: Consectetur,
183     elit: Elit,
184 ) -> T {
185     // body
186 }
187 ```
188
189 #### `"Visual"`:
190
191 ```rust
192 fn lorem<Ipsum: Eq = usize,
193          Dolor: Eq = usize,
194          Sit: Eq = usize,
195          Amet: Eq = usize,
196          Adipiscing: Eq = usize,
197          Consectetur: Eq = usize,
198          Elit: Eq = usize>(
199     ipsum: Ipsum,
200     dolor: Dolor,
201     sit: Sit,
202     amet: Amet,
203     adipiscing: Adipiscing,
204     consectetur: Consectetur,
205     elit: Elit)
206     -> T {
207     // body
208 }
209 ```
210
211 #### Struct
212
213 #### `"Block"` (default):
214
215 ```rust
216 fn main() {
217     let lorem = Lorem {
218         ipsum: dolor,
219         sit: amet,
220     };
221 }
222 ```
223
224 #### `"Visual"`:
225
226 ```rust
227 fn main() {
228     let lorem = Lorem { ipsum: dolor,
229                         sit: amet, };
230 }
231 ```
232
233 See also: [`struct_lit_single_line`](#struct_lit_single_line), [`indent_style`](#indent_style).
234
235 ### Where predicates
236
237 #### `"Block"` (default):
238
239 ```rust
240 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
241 where
242     Ipsum: Eq,
243     Dolor: Eq,
244     Sit: Eq,
245     Amet: Eq,
246 {
247     // body
248 }
249 ```
250
251 #### `"Visual"`:
252
253 ```rust
254 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
255     where Ipsum: Eq,
256           Dolor: Eq,
257           Sit: Eq,
258           Amet: Eq
259 {
260     // body
261 }
262 ```
263
264 ## `use_small_heuristics`
265
266 Whether to use different formatting for items and expressions if they satisfy a heuristic notion of 'small'.
267
268 - **Default value**: `true`
269 - **Possible values**: `true`, `false`
270 - **Stable**: No
271
272 #### `true` (default):
273
274 ```rust
275 enum Lorem {
276     Ipsum,
277     Dolor(bool),
278     Sit { amet: Consectetur, adipiscing: Elit },
279 }
280
281 fn main() {
282     lorem(
283         "lorem",
284         "ipsum",
285         "dolor",
286         "sit",
287         "amet",
288         "consectetur",
289         "adipiscing",
290     );
291
292     let lorem = Lorem {
293         ipsum: dolor,
294         sit: amet,
295     };
296     let lorem = Lorem { ipsum: dolor };
297
298     let lorem = if ipsum { dolor } else { sit };
299 }
300 ```
301
302 #### `false`:
303
304 ```rust
305 enum Lorem {
306     Ipsum,
307     Dolor(bool),
308     Sit {
309         amet: Consectetur,
310         adipiscing: Elit,
311     },
312 }
313
314 fn main() {
315     lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing");
316
317     let lorem = Lorem {
318         ipsum: dolor,
319         sit: amet,
320     };
321
322     let lorem = if ipsum {
323         dolor
324     } else {
325         sit
326     };
327 }
328 ```
329
330 ## `binop_separator`
331
332 Where to put a binary operator when a binary expression goes multiline.
333
334 - **Default value**: `"Front"`
335 - **Possible values**: `"Front"`, `"Back"`
336 - **Stable**: No
337
338 #### `"Front"` (default):
339
340 ```rust
341 fn main() {
342     let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo
343         || barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
344
345     let sum = 123456789012345678901234567890 + 123456789012345678901234567890
346         + 123456789012345678901234567890;
347
348     let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
349         ..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
350 }
351 ```
352
353 #### `"Back"`:
354
355 ```rust
356 fn main() {
357     let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo ||
358         barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
359
360     let sum = 123456789012345678901234567890 + 123456789012345678901234567890 +
361         123456789012345678901234567890;
362
363     let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..
364         bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
365 }
366 ```
367
368 ## `combine_control_expr`
369
370 Combine control expressions with function calls.
371
372 - **Default value**: `true`
373 - **Possible values**: `true`, `false`
374 - **Stable**: No
375
376 #### `true` (default):
377
378 ```rust
379 fn example() {
380     // If
381     foo!(if x {
382         foo();
383     } else {
384         bar();
385     });
386
387     // IfLet
388     foo!(if let Some(..) = x {
389         foo();
390     } else {
391         bar();
392     });
393
394     // While
395     foo!(while x {
396         foo();
397         bar();
398     });
399
400     // WhileLet
401     foo!(while let Some(..) = x {
402         foo();
403         bar();
404     });
405
406     // ForLoop
407     foo!(for x in y {
408         foo();
409         bar();
410     });
411
412     // Loop
413     foo!(loop {
414         foo();
415         bar();
416     });
417 }
418 ```
419
420 #### `false`:
421
422 ```rust
423 fn example() {
424     // If
425     foo!(
426         if x {
427             foo();
428         } else {
429             bar();
430         }
431     );
432
433     // IfLet
434     foo!(
435         if let Some(..) = x {
436             foo();
437         } else {
438             bar();
439         }
440     );
441
442     // While
443     foo!(
444         while x {
445             foo();
446             bar();
447         }
448     );
449
450     // WhileLet
451     foo!(
452         while let Some(..) = x {
453             foo();
454             bar();
455         }
456     );
457
458     // ForLoop
459     foo!(
460         for x in y {
461             foo();
462             bar();
463         }
464     );
465
466     // Loop
467     foo!(
468         loop {
469             foo();
470             bar();
471         }
472     );
473 }
474 ```
475
476 ## `comment_width`
477
478 Maximum length of comments. No effect unless`wrap_comments = true`.
479
480 - **Default value**: `80`
481 - **Possible values**: any positive integer
482 - **Stable**: No
483
484 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
485
486 #### `80` (default; comments shorter than `comment_width`):
487 ```rust
488 // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
489 ```
490
491 #### `60` (comments longer than `comment_width`):
492 ```rust
493 // Lorem ipsum dolor sit amet,
494 // consectetur adipiscing elit.
495 ```
496
497 See also [`wrap_comments`](#wrap_comments).
498
499 ## `condense_wildcard_suffixes`
500
501 Replace strings of _ wildcards by a single .. in tuple patterns
502
503 - **Default value**: `false`
504 - **Possible values**: `true`, `false`
505 - **Stable**: No
506
507 #### `false` (default):
508
509 ```rust
510 fn main() {
511     let (lorem, ipsum, _, _) = (1, 2, 3, 4);
512     let (lorem, ipsum, ..) = (1, 2, 3, 4);
513 }
514 ```
515
516 #### `true`:
517
518 ```rust
519 fn main() {
520     let (lorem, ipsum, ..) = (1, 2, 3, 4);
521 }
522 ```
523
524 ## `control_brace_style`
525
526 Brace style for control flow constructs
527
528 - **Default value**: `"AlwaysSameLine"`
529 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
530 - **Stable**: No
531
532 #### `"AlwaysSameLine"` (default):
533
534 ```rust
535 fn main() {
536     if lorem {
537         println!("ipsum!");
538     } else {
539         println!("dolor!");
540     }
541 }
542 ```
543
544 #### `"AlwaysNextLine"`:
545
546 ```rust
547 fn main() {
548     if lorem
549     {
550         println!("ipsum!");
551     }
552     else
553     {
554         println!("dolor!");
555     }
556 }
557 ```
558
559 #### `"ClosingNextLine"`:
560
561 ```rust
562 fn main() {
563     if lorem {
564         println!("ipsum!");
565     }
566     else {
567         println!("dolor!");
568     }
569 }
570 ```
571
572 ## `disable_all_formatting`
573
574 Don't reformat anything
575
576 - **Default value**: `false`
577 - **Possible values**: `true`, `false`
578 - **Stable**: No
579
580 ## `error_on_line_overflow`
581
582 Error if Rustfmt is unable to get all lines within `max_width`, except for comments and string
583 literals. If this happens, then it is a bug in Rustfmt. You might be able to work around the bug by
584 refactoring your code to avoid long/complex expressions, usually by extracting a local variable or
585 using a shorter name.
586
587 - **Default value**: `false`
588 - **Possible values**: `true`, `false`
589 - **Stable**: No
590
591 See also [`max_width`](#max_width).
592
593 ## `error_on_unformatted`
594
595 Error if unable to get comments or string literals within `max_width`, or they are left with
596 trailing whitespaces.
597
598 - **Default value**: `false`
599 - **Possible values**: `true`, `false`
600 - **Stable**: No
601
602 ## `fn_args_density`
603
604 Argument density in functions
605
606 - **Default value**: `"Tall"`
607 - **Possible values**: `"Compressed"`, `"Tall"`, `"Vertical"`
608 - **Stable**: No
609
610 #### `"Tall"` (default):
611
612 ```rust
613 trait Lorem {
614     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
615
616     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
617         // body
618     }
619
620     fn lorem(
621         ipsum: Ipsum,
622         dolor: Dolor,
623         sit: Sit,
624         amet: Amet,
625         consectetur: Consectetur,
626         adipiscing: Adipiscing,
627         elit: Elit,
628     );
629
630     fn lorem(
631         ipsum: Ipsum,
632         dolor: Dolor,
633         sit: Sit,
634         amet: Amet,
635         consectetur: Consectetur,
636         adipiscing: Adipiscing,
637         elit: Elit,
638     ) {
639         // body
640     }
641 }
642 ```
643
644 #### `"Compressed"`:
645
646 ```rust
647 trait Lorem {
648     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
649
650     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
651         // body
652     }
653
654     fn lorem(
655         ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
656         adipiscing: Adipiscing, elit: Elit,
657     );
658
659     fn lorem(
660         ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
661         adipiscing: Adipiscing, elit: Elit,
662     ) {
663         // body
664     }
665 }
666 ```
667
668 #### `"Vertical"`:
669
670 ```rust
671 trait Lorem {
672     fn lorem(
673         ipsum: Ipsum,
674         dolor: Dolor,
675         sit: Sit,
676         amet: Amet,
677     );
678
679     fn lorem(
680         ipsum: Ipsum,
681         dolor: Dolor,
682         sit: Sit,
683         amet: Amet,
684     ) {
685         // body
686     }
687
688     fn lorem(
689         ipsum: Ipsum,
690         dolor: Dolor,
691         sit: Sit,
692         amet: Amet,
693         consectetur: Consectetur,
694         adipiscing: Adipiscing,
695         elit: Elit,
696     );
697
698     fn lorem(
699         ipsum: Ipsum,
700         dolor: Dolor,
701         sit: Sit,
702         amet: Amet,
703         consectetur: Consectetur,
704         adipiscing: Adipiscing,
705         elit: Elit,
706     ) {
707         // body
708     }
709 }
710 ```
711
712
713 ## `brace_style`
714
715 Brace style for items
716
717 - **Default value**: `"SameLineWhere"`
718 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
719 - **Stable**: No
720
721 ### Functions
722
723 #### `"SameLineWhere"` (default):
724
725 ```rust
726 fn lorem() {
727     // body
728 }
729
730 fn lorem(ipsum: usize) {
731     // body
732 }
733
734 fn lorem<T>(ipsum: T)
735 where
736     T: Add + Sub + Mul + Div,
737 {
738     // body
739 }
740 ```
741
742 #### `"AlwaysNextLine"`:
743
744 ```rust
745 fn lorem()
746 {
747     // body
748 }
749
750 fn lorem(ipsum: usize)
751 {
752     // body
753 }
754
755 fn lorem<T>(ipsum: T)
756 where
757     T: Add + Sub + Mul + Div,
758 {
759     // body
760 }
761 ```
762
763 #### `"PreferSameLine"`:
764
765 ```rust
766 fn lorem() {
767     // body
768 }
769
770 fn lorem(ipsum: usize) {
771     // body
772 }
773
774 fn lorem<T>(ipsum: T)
775 where
776     T: Add + Sub + Mul + Div, {
777     // body
778 }
779 ```
780
781 ### Structs and enums
782
783 #### `"SameLineWhere"` (default):
784
785 ```rust
786 struct Lorem {
787     ipsum: bool,
788 }
789
790 struct Dolor<T>
791 where
792     T: Eq,
793 {
794     sit: T,
795 }
796 ```
797
798 #### `"AlwaysNextLine"`:
799
800 ```rust
801 struct Lorem
802 {
803     ipsum: bool,
804 }
805
806 struct Dolor<T>
807 where
808     T: Eq,
809 {
810     sit: T,
811 }
812 ```
813
814 #### `"PreferSameLine"`:
815
816 ```rust
817 struct Lorem {
818     ipsum: bool,
819 }
820
821 struct Dolor<T>
822 where
823     T: Eq, {
824     sit: T,
825 }
826 ```
827
828
829 ## `empty_item_single_line`
830
831 Put empty-body functions and impls on a single line
832
833 - **Default value**: `true`
834 - **Possible values**: `true`, `false`
835 - **Stable**: No
836
837 #### `true` (default):
838
839 ```rust
840 fn lorem() {}
841
842 impl Lorem {}
843 ```
844
845 #### `false`:
846
847 ```rust
848 fn lorem() {
849 }
850
851 impl Lorem {
852 }
853 ```
854
855 See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_style).
856
857
858 ## `fn_single_line`
859
860 Put single-expression functions on a single line
861
862 - **Default value**: `false`
863 - **Possible values**: `true`, `false`
864 - **Stable**: No
865
866 #### `false` (default):
867
868 ```rust
869 fn lorem() -> usize {
870     42
871 }
872
873 fn lorem() -> usize {
874     let ipsum = 42;
875     ipsum
876 }
877 ```
878
879 #### `true`:
880
881 ```rust
882 fn lorem() -> usize { 42 }
883
884 fn lorem() -> usize {
885     let ipsum = 42;
886     ipsum
887 }
888 ```
889
890 See also [`control_brace_style`](#control_brace_style).
891
892
893 ## `where_single_line`
894
895 Forces the `where` clause to be laid out on a single line.
896
897 - **Default value**: `false`
898 - **Possible values**: `true`, `false`
899 - **Stable**: No
900
901 #### `false` (default):
902
903 ```rust
904 impl<T> Lorem for T
905 where
906     Option<T>: Ipsum,
907 {
908     // body
909 }
910 ```
911
912 #### `true`:
913
914 ```rust
915 impl<T> Lorem for T
916 where Option<T>: Ipsum
917 {
918     // body
919 }
920 ```
921
922 See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_style).
923
924
925 ## `force_explicit_abi`
926
927 Always print the abi for extern items
928
929 - **Default value**: `true`
930 - **Possible values**: `true`, `false`
931 - **Stable**: Yes
932
933 **Note:** Non-"C" ABIs are always printed. If `false` then "C" is removed.
934
935 #### `true` (default):
936
937 ```rust
938 extern "C" {
939     pub static lorem: c_int;
940 }
941 ```
942
943 #### `false`:
944
945 ```rust
946 extern {
947     pub static lorem: c_int;
948 }
949 ```
950
951 ## `format_strings`
952
953 Format string literals where necessary
954
955 - **Default value**: `false`
956 - **Possible values**: `true`, `false`
957 - **Stable**: No
958
959 #### `false` (default):
960
961 ```rust
962 fn main() {
963     let lorem =
964         "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing";
965 }
966 ```
967
968 #### `true`:
969
970 ```rust
971 fn main() {
972     let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet \
973                  consectetur adipiscing";
974 }
975 ```
976
977 See also [`max_width`](#max_width).
978
979 ## `hard_tabs`
980
981 Use tab characters for indentation, spaces for alignment
982
983 - **Default value**: `false`
984 - **Possible values**: `true`, `false`
985 - **Stable**: Yes
986
987 #### `false` (default):
988
989 ```rust
990 fn lorem() -> usize {
991     42 // spaces before 42
992 }
993 ```
994
995 #### `true`:
996
997 ```rust
998 fn lorem() -> usize {
999         42 // tabs before 42
1000 }
1001 ```
1002
1003 See also: [`tab_spaces`](#tab_spaces).
1004
1005
1006 ## `imports_indent`
1007
1008 Indent style of imports
1009
1010 - **Default Value**: `"Visual"`
1011 - **Possible values**: `"Block"`, `"Visual"`
1012 - **Stable**: No
1013
1014 #### `"Visual"` (default):
1015
1016 ```rust
1017 use foo::{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
1018           zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz};
1019 ```
1020
1021 #### `"Block"`:
1022
1023 ```rust
1024 use foo::{
1025     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
1026     zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz,
1027 };
1028 ```
1029
1030 See also: [`imports_layout`](#imports_layout).
1031
1032 ## `imports_layout`
1033
1034 Item layout inside a imports block
1035
1036 - **Default value**: "Mixed"
1037 - **Possible values**: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
1038 - **Stable**: No
1039
1040 #### `"Mixed"` (default):
1041
1042 ```rust
1043 use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
1044
1045 use foo::{
1046     aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbb, cccccccccccccccccc, dddddddddddddddddd,
1047     eeeeeeeeeeeeeeeeee, ffffffffffffffffff,
1048 };
1049 ```
1050
1051 #### `"Horizontal"`:
1052
1053 **Note**: This option forces all imports onto one line and may exceed `max_width`.
1054
1055 ```rust
1056 use foo::{xxx, yyy, zzz};
1057
1058 use foo::{aaa, bbb, ccc, ddd, eee, fff};
1059 ```
1060
1061 #### `"HorizontalVertical"`:
1062
1063 ```rust
1064 use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
1065
1066 use foo::{
1067     aaaaaaaaaaaaaaaaaa,
1068     bbbbbbbbbbbbbbbbbb,
1069     cccccccccccccccccc,
1070     dddddddddddddddddd,
1071     eeeeeeeeeeeeeeeeee,
1072     ffffffffffffffffff,
1073 };
1074 ```
1075
1076 #### `"Vertical"`:
1077
1078 ```rust
1079 use foo::{
1080     xxx,
1081     yyy,
1082     zzz,
1083 };
1084
1085 use foo::{
1086     aaa,
1087     bbb,
1088     ccc,
1089     ddd,
1090     eee,
1091     fff,
1092 };
1093 ```
1094
1095 ## `merge_imports`
1096
1097 Merge multiple imports into a single nested import.
1098
1099 - **Default value**: `false`
1100 - **Possible values**: `true`, `false`
1101 - **Stable**: No
1102
1103 #### `false` (default):
1104
1105 ```rust
1106 use foo::{a, c, d};
1107 use foo::{b, g};
1108 use foo::{e, f};
1109 ```
1110
1111 #### `true`:
1112
1113 ```rust
1114 use foo::{a, b, c, d, e, f, g};
1115 ```
1116
1117
1118 ## `match_block_trailing_comma`
1119
1120 Put a trailing comma after a block based match arm (non-block arms are not affected)
1121
1122 - **Default value**: `false`
1123 - **Possible values**: `true`, `false`
1124 - **Stable**: No
1125
1126 #### `false` (default):
1127
1128 ```rust
1129 fn main() {
1130     match lorem {
1131         Lorem::Ipsum => {
1132             println!("ipsum");
1133         }
1134         Lorem::Dolor => println!("dolor"),
1135     }
1136 }
1137 ```
1138
1139 #### `true`:
1140
1141 ```rust
1142 fn main() {
1143     match lorem {
1144         Lorem::Ipsum => {
1145             println!("ipsum");
1146         },
1147         Lorem::Dolor => println!("dolor"),
1148     }
1149 }
1150 ```
1151
1152 See also: [`trailing_comma`](#trailing_comma), [`match_arm_blocks`](#match_arm_blocks).
1153
1154 ## `max_width`
1155
1156 Maximum width of each line
1157
1158 - **Default value**: `100`
1159 - **Possible values**: any positive integer
1160 - **Stable**: Yes
1161
1162 See also [`error_on_line_overflow`](#error_on_line_overflow).
1163
1164 ## `merge_derives`
1165
1166 Merge multiple derives into a single one.
1167
1168 - **Default value**: `true`
1169 - **Possible values**: `true`, `false`
1170 - **Stable**: Yes
1171
1172 #### `true` (default):
1173
1174 ```rust
1175 #[derive(Eq, PartialEq, Debug, Copy, Clone)]
1176 pub enum Foo {}
1177 ```
1178
1179 #### `false`:
1180
1181 ```rust
1182 #[derive(Eq, PartialEq)]
1183 #[derive(Debug)]
1184 #[derive(Copy, Clone)]
1185 pub enum Foo {}
1186 ```
1187
1188 ## `force_multiline_blocks`
1189
1190 Force multiline closure and match arm bodies to be wrapped in a block
1191
1192 - **Default value**: `false`
1193 - **Possible values**: `false`, `true`
1194 - **Stable**: No
1195
1196 #### `false` (default):
1197
1198 ```rust
1199 fn main() {
1200     result.and_then(|maybe_value| match maybe_value {
1201         None => foo(),
1202         Some(value) => bar(),
1203     });
1204
1205     match lorem {
1206         None => if ipsum {
1207             println!("Hello World");
1208         },
1209         Some(dolor) => foo(),
1210     }
1211 }
1212 ```
1213
1214 #### `true`:
1215
1216 ```rust
1217 fn main() {
1218     result.and_then(|maybe_value| {
1219         match maybe_value {
1220             None => foo(),
1221             Some(value) => bar(),
1222         }
1223     });
1224
1225     match lorem {
1226         None => {
1227             if ipsum {
1228                 println!("Hello World");
1229             }
1230         }
1231         Some(dolor) => foo(),
1232     }
1233 }
1234 ```
1235
1236
1237 ## `newline_style`
1238
1239 Unix or Windows line endings
1240
1241 - **Default value**: `"Unix"`
1242 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1243 - **Stable**: Yes
1244
1245 ## `normalize_comments`
1246
1247 Convert /* */ comments to // comments where possible
1248
1249 - **Default value**: `false`
1250 - **Possible values**: `true`, `false`
1251 - **Stable**: Yes
1252
1253 #### `false` (default):
1254
1255 ```rust
1256 // Lorem ipsum:
1257 fn dolor() -> usize {}
1258
1259 /* sit amet: */
1260 fn adipiscing() -> usize {}
1261 ```
1262
1263 #### `true`:
1264
1265 ```rust
1266 // Lorem ipsum:
1267 fn dolor() -> usize {}
1268
1269 // sit amet:
1270 fn adipiscing() -> usize {}
1271 ```
1272
1273 ## `remove_nested_parens`
1274
1275 Remove nested parens.
1276
1277 - **Defalut value**: `false`,
1278 - **Possible values**: `true`, `false`
1279 - **Stable**: No
1280
1281 #### `false` (default):
1282 ```rust
1283 fn main() {
1284     ((((foo()))));
1285 }
1286 ```
1287
1288 ### `true`:
1289 ```rust
1290 fn main() {
1291     (foo());
1292 }
1293 ```
1294
1295
1296 ## `reorder_imports`
1297
1298 Reorder import and extern crate statements alphabetically in groups (a group is
1299 separated by a newline).
1300
1301 - **Default value**: `true`
1302 - **Possible values**: `true`, `false`
1303 - **Stable**: No
1304
1305 #### `true` (default):
1306
1307 ```rust
1308 use dolor;
1309 use ipsum;
1310 use lorem;
1311 use sit;
1312 ```
1313
1314 #### `false`:
1315
1316 ```rust
1317 use lorem;
1318 use ipsum;
1319 use dolor;
1320 use sit;
1321 ```
1322
1323
1324 ## `reorder_modules`
1325
1326 Reorder `mod` declarations alphabetically in group.
1327
1328 - **Default value**: `true`
1329 - **Possible values**: `true`, `false`
1330 - **Stable**: No
1331
1332 #### `true` (default)
1333
1334 ```rust
1335 mod a;
1336 mod b;
1337
1338 mod dolor;
1339 mod ipsum;
1340 mod lorem;
1341 mod sit;
1342 ```
1343
1344 #### `false`
1345
1346 ```rust
1347 mod b;
1348 mod a;
1349
1350 mod lorem;
1351 mod ipsum;
1352 mod dolor;
1353 mod sit;
1354 ```
1355
1356 **Note** `mod` with `#[macro_export]` will not be reordered since that could change the semantic
1357 of the original source code.
1358
1359 ## `reorder_impl_items`
1360
1361 Reorder impl items. `type` and `const` are put first, then macros and methods.
1362
1363 - **Default value**: `false`
1364 - **Possible values**: `true`, `false`
1365 - **Stable**: No
1366
1367 #### `false` (default)
1368
1369 ```rust
1370 struct Dummy;
1371
1372 impl Iterator for Dummy {
1373     fn next(&mut self) -> Option<Self::Item> {
1374         None
1375     }
1376
1377     type Item = i32;
1378 }
1379 ```
1380
1381 #### `true`
1382
1383 ```rust
1384 struct Dummy;
1385
1386 impl Iterator for Dummy {
1387     type Item = i32;
1388
1389     fn next(&mut self) -> Option<Self::Item> {
1390         None
1391     }
1392 }
1393 ```
1394
1395 ## `report_todo`
1396
1397 Report `TODO` items in comments.
1398
1399 - **Default value**: `"Never"`
1400 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
1401 - **Stable**: No
1402
1403 Warns about any comments containing `TODO` in them when set to `"Always"`. If
1404 it contains a `#X` (with `X` being a number) in parentheses following the
1405 `TODO`, `"Unnumbered"` will ignore it.
1406
1407 See also [`report_fixme`](#report_fixme).
1408
1409 ## `report_fixme`
1410
1411 Report `FIXME` items in comments.
1412
1413 - **Default value**: `"Never"`
1414 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
1415 - **Stable**: No
1416
1417 Warns about any comments containing `FIXME` in them when set to `"Always"`. If
1418 it contains a `#X` (with `X` being a number) in parentheses following the
1419 `FIXME`, `"Unnumbered"` will ignore it.
1420
1421 See also [`report_todo`](#report_todo).
1422
1423
1424 ## `skip_children`
1425
1426 Don't reformat out of line modules
1427
1428 - **Default value**: `false`
1429 - **Possible values**: `true`, `false`
1430 - **Stable**: No
1431
1432 ## `space_after_colon`
1433
1434 Leave a space after the colon.
1435
1436 - **Default value**: `true`
1437 - **Possible values**: `true`, `false`
1438 - **Stable**: No
1439
1440 #### `true` (default):
1441
1442 ```rust
1443 fn lorem<T: Eq>(t: T) {
1444     let lorem: Dolor = Lorem {
1445         ipsum: dolor,
1446         sit: amet,
1447     };
1448 }
1449 ```
1450
1451 #### `false`:
1452
1453 ```rust
1454 fn lorem<T:Eq>(t:T) {
1455     let lorem:Dolor = Lorem {
1456         ipsum:dolor,
1457         sit:amet,
1458     };
1459 }
1460 ```
1461
1462 See also: [`space_before_colon`](#space_before_colon).
1463
1464 ## `space_before_colon`
1465
1466 Leave a space before the colon.
1467
1468 - **Default value**: `false`
1469 - **Possible values**: `true`, `false`
1470 - **Stable**: No
1471
1472 #### `false` (default):
1473
1474 ```rust
1475 fn lorem<T: Eq>(t: T) {
1476     let lorem: Dolor = Lorem {
1477         ipsum: dolor,
1478         sit: amet,
1479     };
1480 }
1481 ```
1482
1483 #### `true`:
1484
1485 ```rust
1486 fn lorem<T : Eq>(t : T) {
1487     let lorem : Dolor = Lorem {
1488         ipsum : dolor,
1489         sit : amet,
1490     };
1491 }
1492 ```
1493
1494 See also: [`space_after_colon`](#space_after_colon).
1495
1496 ## `struct_field_align_threshold`
1497
1498 The maximum diff of width between struct fields to be aligned with each other.
1499
1500 - **Default value** : 0
1501 - **Possible values**: any positive integer
1502 - **Stable**: No
1503
1504 #### `0` (default):
1505
1506 ```rust
1507 struct Foo {
1508     x: u32,
1509     yy: u32,
1510     zzz: u32,
1511 }
1512 ```
1513
1514 #### `20`:
1515
1516 ```rust
1517 struct Foo {
1518     x:   u32,
1519     yy:  u32,
1520     zzz: u32,
1521 }
1522 ```
1523
1524 ## `spaces_around_ranges`
1525
1526 Put spaces around the .., ..=, and ... range operators
1527
1528 - **Default value**: `false`
1529 - **Possible values**: `true`, `false`
1530 - **Stable**: No
1531
1532 #### `false` (default):
1533
1534 ```rust
1535 fn main() {
1536     let lorem = 0..10;
1537     let ipsum = 0..=10;
1538
1539     match lorem {
1540         1..5 => foo(),
1541         _ => bar,
1542     }
1543
1544     match lorem {
1545         1..=5 => foo(),
1546         _ => bar,
1547     }
1548
1549     match lorem {
1550         1...5 => foo(),
1551         _ => bar,
1552     }
1553 }
1554 ```
1555
1556 #### `true`:
1557
1558 ```rust
1559 fn main() {
1560     let lorem = 0 .. 10;
1561     let ipsum = 0 ..= 10;
1562
1563     match lorem {
1564         1 .. 5 => foo(),
1565         _ => bar,
1566     }
1567
1568     match lorem {
1569         1 ..= 5 => foo(),
1570         _ => bar,
1571     }
1572
1573     match lorem {
1574         1 ... 5 => foo(),
1575         _ => bar,
1576     }
1577 }
1578 ```
1579
1580 ## `spaces_within_parens_and_brackets`
1581
1582 Put spaces within non-empty generic arguments, parentheses, and square brackets
1583
1584 - **Default value**: `false`
1585 - **Possible values**: `true`, `false`
1586 - **Stable**: No
1587
1588 #### `false` (default):
1589
1590 ```rust
1591 // generic arguments
1592 fn lorem<T: Eq>(t: T) {
1593     // body
1594 }
1595
1596 // non-empty parentheses
1597 fn lorem<T: Eq>(t: T) {
1598     let lorem = (ipsum, dolor);
1599 }
1600
1601 // non-empty square brackets
1602 fn lorem<T: Eq>(t: T) {
1603     let lorem: [usize; 2] = [ipsum, dolor];
1604 }
1605 ```
1606
1607 #### `true`:
1608
1609 ```rust
1610 // generic arguments
1611 fn lorem< T: Eq >( t: T ) {
1612     // body
1613 }
1614
1615 // non-empty parentheses
1616 fn lorem< T: Eq >( t: T ) {
1617     let lorem = ( ipsum, dolor );
1618 }
1619
1620 // non-empty square brackets
1621 fn lorem< T: Eq >( t: T ) {
1622     let lorem: [ usize; 2 ] = [ ipsum, dolor ];
1623 }
1624 ```
1625
1626 ## `struct_lit_single_line`
1627
1628 Put small struct literals on a single line
1629
1630 - **Default value**: `true`
1631 - **Possible values**: `true`, `false`
1632 - **Stable**: No
1633
1634 #### `true` (default):
1635
1636 ```rust
1637 fn main() {
1638     let lorem = Lorem { foo: bar, baz: ofo };
1639 }
1640 ```
1641
1642 #### `false`:
1643
1644 ```rust
1645 fn main() {
1646     let lorem = Lorem {
1647         foo: bar,
1648         baz: ofo,
1649     };
1650 }
1651 ```
1652
1653 See also: [`indent_style`](#indent_style).
1654
1655
1656 ## `tab_spaces`
1657
1658 Number of spaces per tab
1659
1660 - **Default value**: `4`
1661 - **Possible values**: any positive integer
1662 - **Stable**: Yes
1663
1664 #### `4` (default):
1665
1666 ```rust
1667 fn lorem() {
1668     let ipsum = dolor();
1669     let sit = vec![
1670         "amet consectetur adipiscing elit amet",
1671         "consectetur adipiscing elit amet consectetur.",
1672     ];
1673 }
1674 ```
1675
1676 #### `2`:
1677
1678 ```rust
1679 fn lorem() {
1680   let ipsum = dolor();
1681   let sit = vec![
1682     "amet consectetur adipiscing elit amet",
1683     "consectetur adipiscing elit amet consectetur.",
1684   ];
1685 }
1686 ```
1687
1688 See also: [`hard_tabs`](#hard_tabs).
1689
1690
1691 ## `trailing_comma`
1692
1693 How to handle trailing commas for lists
1694
1695 - **Default value**: `"Vertical"`
1696 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1697 - **Stable**: No
1698
1699 #### `"Vertical"` (default):
1700
1701 ```rust
1702 fn main() {
1703     let Lorem { ipsum, dolor, sit } = amet;
1704     let Lorem {
1705         ipsum,
1706         dolor,
1707         sit,
1708         amet,
1709         consectetur,
1710         adipiscing,
1711     } = elit;
1712 }
1713 ```
1714
1715 #### `"Always"`:
1716
1717 ```rust
1718 fn main() {
1719     let Lorem { ipsum, dolor, sit, } = amet;
1720     let Lorem {
1721         ipsum,
1722         dolor,
1723         sit,
1724         amet,
1725         consectetur,
1726         adipiscing,
1727     } = elit;
1728 }
1729 ```
1730
1731 #### `"Never"`:
1732
1733 ```rust
1734 fn main() {
1735     let Lorem { ipsum, dolor, sit } = amet;
1736     let Lorem {
1737         ipsum,
1738         dolor,
1739         sit,
1740         amet,
1741         consectetur,
1742         adipiscing
1743     } = elit;
1744 }
1745 ```
1746
1747 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1748
1749 ## `trailing_semicolon`
1750
1751 Add trailing semicolon after break, continue and return
1752
1753 - **Default value**: `true`
1754 - **Possible values**: `true`, `false`
1755 - **Stable**: No
1756
1757 #### `true` (default):
1758 ```rust
1759 fn foo() -> usize {
1760     return 0;
1761 }
1762 ```
1763
1764 #### `false`:
1765 ```rust
1766 fn foo() -> usize {
1767     return 0
1768 }
1769 ```
1770
1771 ## `type_punctuation_density`
1772
1773 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1774
1775 - **Default value**: `"Wide"`
1776 - **Possible values**: `"Compressed"`, `"Wide"`
1777 - **Stable**: No
1778
1779 #### `"Wide"` (default):
1780
1781 ```rust
1782 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1783     // body
1784 }
1785 ```
1786
1787 #### `"Compressed"`:
1788
1789 ```rust
1790 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1791     // body
1792 }
1793 ```
1794
1795 ## `use_field_init_shorthand`
1796
1797 Use field initialize shorthand if possible.
1798
1799 - **Default value**: `false`
1800 - **Possible values**: `true`, `false`
1801 - **Stable**: No
1802
1803 #### `false` (default):
1804
1805 ```rust
1806 struct Foo {
1807     x: u32,
1808     y: u32,
1809     z: u32,
1810 }
1811
1812 fn main() {
1813     let x = 1;
1814     let y = 2;
1815     let z = 3;
1816     let a = Foo { x: x, y: y, z: z };
1817 }
1818 ```
1819
1820 #### `true`:
1821
1822 ```rust
1823 struct Foo {
1824     x: u32,
1825     y: u32,
1826     z: u32,
1827 }
1828
1829 fn main() {
1830     let x = 1;
1831     let y = 2;
1832     let z = 3;
1833     let a = Foo { x, y, z };
1834 }
1835 ```
1836
1837 ## `use_try_shorthand`
1838
1839 Replace uses of the try! macro by the ? shorthand
1840
1841 - **Default value**: `false`
1842 - **Possible values**: `true`, `false`
1843 - **Stable**: No
1844
1845 #### `false` (default):
1846
1847 ```rust
1848 fn main() {
1849     let lorem = try!(ipsum.map(|dolor| dolor.sit()));
1850 }
1851 ```
1852
1853 #### `true`:
1854
1855 ```rust
1856 fn main() {
1857     let lorem = ipsum.map(|dolor| dolor.sit())?;
1858 }
1859 ```
1860
1861
1862 ## `wrap_comments`
1863
1864 Break comments to fit on the line
1865
1866 - **Default value**: `false`
1867 - **Possible values**: `true`, `false`
1868 - **Stable**: Yes
1869
1870 #### `false` (default):
1871
1872 ```rust
1873 // 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.
1874 ```
1875
1876 #### `true`:
1877
1878 ```rust
1879 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
1880 // sed do eiusmod tempor incididunt ut labore et dolore
1881 // magna aliqua. Ut enim ad minim veniam, quis nostrud
1882 // exercitation ullamco laboris nisi ut aliquip ex ea
1883 // commodo consequat.
1884 ```
1885
1886 ## `match_arm_blocks`
1887
1888 Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
1889
1890 - **Default value**: `true`
1891 - **Possible values**: `true`, `false`
1892 - **Stable**: No
1893
1894 #### `true` (default):
1895
1896 ```rust
1897 fn main() {
1898     match lorem {
1899         true => {
1900             foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
1901         }
1902         false => println!("{}", sit),
1903     }
1904 }
1905 ```
1906
1907 #### `false`:
1908
1909 ```rust
1910 fn main() {
1911     match lorem {
1912         true =>
1913             foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
1914         false => println!("{}", sit),
1915     }
1916 }
1917 ```
1918
1919 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1920
1921 ## `write_mode`
1922
1923 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
1924
1925 - **Default value**: `"Overwrite"`
1926 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`
1927 - **Stable**: No
1928
1929 ## `blank_lines_upper_bound`
1930
1931 Maximum number of blank lines which can be put between items. If more than this number of consecutive empty
1932 lines are found, they are trimmed down to match this integer.
1933
1934 - **Default value**: `1`
1935 - **Possible values**: *unsigned integer*
1936 - **Stable**: No
1937
1938 ### Example
1939 Original Code:
1940
1941 ```rust
1942 #![rustfmt_skip]
1943
1944 fn foo() {
1945     println!("a");
1946 }
1947
1948
1949
1950 fn bar() {
1951     println!("b");
1952
1953
1954     println!("c");
1955 }
1956 ```
1957
1958 #### `1` (default):
1959 ```rust
1960 fn foo() {
1961     println!("a");
1962 }
1963
1964 fn bar() {
1965     println!("b");
1966
1967     println!("c");
1968 }
1969 ```
1970
1971 #### `2` (default):
1972 ```rust
1973 fn foo() {
1974     println!("a");
1975 }
1976
1977
1978 fn bar() {
1979     println!("b");
1980
1981
1982     println!("c");
1983 }
1984 ```
1985
1986 See also: [`blank_lines_lower_bound`](#blank_lines_lower_bound)
1987
1988 ## `blank_lines_lower_bound`
1989
1990 Minimum number of blank lines which must be put between items. If two items have fewer blank lines between
1991 them, additional blank lines are inserted.
1992
1993 - **Default value**: `0`
1994 - **Possible values**: *unsigned integer*
1995 - **Stable**: No
1996
1997 ### Example
1998 Original Code (rustfmt will not change it with the default value of `0`):
1999
2000 ```rust
2001 #![rustfmt_skip]
2002
2003 fn foo() {
2004     println!("a");
2005 }
2006 fn bar() {
2007     println!("b");
2008     println!("c");
2009 }
2010 ```
2011
2012 #### `1`
2013 ```rust
2014 fn foo() {
2015
2016     println!("a");
2017 }
2018
2019 fn bar() {
2020
2021     println!("b");
2022
2023     println!("c");
2024 }
2025 ```
2026
2027 ## `remove_blank_lines_at_start_or_end_of_block`
2028
2029 Remove blank lines at the start or the end of a block.
2030
2031 - **Default value**: `true`
2032 - **Possible values**: `true`, `false`
2033 - **Stable**: No
2034
2035 #### `true`
2036
2037 ```rust
2038 fn foo() {
2039     let msg = {
2040         let mut str = String::new();
2041         str.push_str("hello, ");
2042         str.push_str("world!");
2043         str
2044     };
2045     println!("{}", msg);
2046 }
2047 ```
2048
2049 #### `false`
2050
2051 ```rust
2052 fn foo() {
2053
2054     let msg = {
2055
2056         let mut str = String::new();
2057         str.push_str("hello, ");
2058         str.push_str("world!");
2059         str
2060
2061     };
2062     println!("{}", msg);
2063
2064 }
2065 ```
2066
2067 ## `required_version`
2068
2069 Require a specific version of rustfmt. If you want to make sure that the
2070 specific version of rustfmt is used in your CI, use this option.
2071
2072 - **Default value**: `CARGO_PKG_VERSION`
2073 - **Possible values**: any published version (e.g. `"0.3.8"`)
2074 - **Stable**: No
2075
2076 ## `hide_parse_errors`
2077
2078 Do not show parse errors if the parser failed to parse files.
2079
2080 - **Default value**: `false`
2081 - **Possible values**: `true`, `false`
2082 - **Stable**: No
2083
2084 ## `color`
2085
2086 Whether to use colored output or not.
2087
2088 - **Default value**: `"Auto"`
2089 - **Possible values**: "Auto", "Always", "Never"
2090 - **Stable**: No
2091
2092 ## `unstable_features`
2093
2094 Enable unstable features on stable channel.
2095
2096 - **Default value**: `false`
2097 - **Possible values**: `true`, `false`
2098 - **Stable**: Yes
2099
2100 ## `license_template_path`
2101
2102 Check whether beginnings of files match a license template.
2103
2104 - **Default value**: `""``
2105 - **Possible values**: path to a license template file
2106 - **Stable**: No
2107
2108 A license template is a plain text file which is matched literally against the
2109 beginning of each source file, except for `{}`-delimited blocks, which are
2110 matched as regular expressions. The following license template therefore
2111 matches strings like `// Copyright 2017 The Rust Project Developers.`, `//
2112 Copyright 2018 The Rust Project Developers.`, etc.:
2113
2114 ```
2115 // Copyright {\d+} The Rust Project Developers.
2116 ```
2117
2118 `\{`, `\}` and `\\` match literal braces / backslashes.
2119
2120 ## `ignore`
2121
2122 Skip formatting the specified files and directories.
2123
2124 - **Default value**: format every files
2125 - **Possible values**: See an example below
2126 - **Stable**: No
2127
2128 ### Example
2129
2130 If you want to ignore specific files, put the following to your config file:
2131
2132 ```toml
2133 ignore = [
2134     "src/types.rs",
2135     "src/foo/bar.rs",
2136 ]
2137 ```
2138
2139 If you want to ignore every file under `examples/`, put the following to your config file:
2140
2141 ```toml
2142 ignore [
2143     "examples",
2144 ]
2145 ```