]> git.lizzy.rs Git - rust.git/blob - Configurations.md
Merge pull request #1654 from topecongiro/over-long-lines
[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 array_layout = "Block"
9 array_width = 80
10 reorder_imported_names = true
11 ```
12
13 # Configuration Options
14
15 Below you find a detailed visual guide on all the supported configuration options of rustfmt:
16
17 ## `array_layout`
18
19 Indent on arrays
20
21 - **Default value**: `"Visual"`
22 - **Possible values**: `"Block"`, `"Visual"`
23
24 #### `"Block"`:
25
26 ```rust
27 let lorem = vec![
28     "ipsum",
29     "dolor",
30     "sit",
31     "amet",
32     "consectetur",
33     "adipiscing",
34     "elit",
35 ];
36 ```
37
38 #### `"Visual"`:
39
40 ```rust
41 let lorem = vec!["ipsum",
42                  "dolor",
43                  "sit",
44                  "amet",
45                  "consectetur",
46                  "adipiscing",
47                  "elit"];
48 ```
49
50 ## `array_width`
51
52 Maximum width of an array literal before falling back to vertical formatting
53
54 - **Default value**: `60`
55 - **Possible values**: any positive integer
56
57 **Note:** A value of `0` results in [`array_layout`](#array_layout) being applied regardless of a line's width.
58
59 #### Lines shorter than `array_width`:
60 ```rust
61 let lorem =
62     vec!["ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit"];
63 ```
64
65 #### Lines longer than `array_width`:
66 See [`array_layout`](#array_layout).
67
68 ## `chain_indent`
69
70 Indentation of chain
71
72 - **Default value**: `"Block"`
73 - **Possible values**: `"Block"`, `"Visual"`
74
75 #### `"Block"`:
76
77 ```rust
78 let lorem = ipsum
79     .dolor()
80     .sit()
81     .amet()
82     .consectetur()
83     .adipiscing()
84     .elit();
85 ```
86
87 #### `"Visual"`:
88
89 ```rust
90 let lorem = ipsum.dolor()
91                  .sit()
92                  .amet()
93                  .consectetur()
94                  .adipiscing()
95                  .elit();
96 ```
97
98 See also [`chain_one_line_max`](#chain_one_line_max).
99
100 ## `chain_one_line_max`
101
102 Maximum length of a chain to fit on a single line
103
104 - **Default value**: `60`
105 - **Possible values**: any positive integer
106
107 #### Lines shorter than `chain_one_line_max`:
108 ```rust
109 let lorem = ipsum.dolor().sit().amet().consectetur().adipiscing().elit();
110 ```
111
112 #### Lines longer than `chain_one_line_max`:
113 See [`chain_indent`](#chain_indent).
114
115 ## `chain_split_single_child`
116
117 Split a chain with a single child if its length exceeds [`chain_one_line_max`](#chain_one_line_max).
118
119 - **Default value**: `false`
120 - **Possible values**: `false`, `true`
121
122 #### `false`
123
124 ```rust
125 let files = fs::read_dir("tests/coverage/source").expect("Couldn't read source dir");
126 ```
127
128 #### `true`
129
130 ```rust
131 let files = fs::read_dir("tests/coverage/source")
132     .expect("Couldn't read source dir");
133 ```
134
135 See also [`chain_one_line_max`](#chain_one_line_max).
136
137 ## `closure_block_indent_threshold`
138
139 How many lines a closure must have before it is block indented. -1 means never use block indent.
140
141 - **Default value**: `7`
142 - **Possible values**: `-1`, or any positive integer
143
144 #### Closures shorter than `closure_block_indent_threshold`:
145 ```rust
146 lorem_ipsum(|| {
147                 println!("lorem");
148                 println!("ipsum");
149                 println!("dolor");
150                 println!("sit");
151                 println!("amet");
152             });
153 ```
154
155 #### Closures longer than `closure_block_indent_threshold`:
156 ```rust
157 lorem_ipsum(|| {
158     println!("lorem");
159     println!("ipsum");
160     println!("dolor");
161     println!("sit");
162     println!("amet");
163     println!("consectetur");
164     println!("adipiscing");
165     println!("elit");
166 });
167 ```
168
169 ## `combine_control_expr`
170
171 Combine control expressions with function calls.
172
173 - **Default value**: `true`
174 - **Possible values**: `true`, `false`
175
176 #### `true`
177
178 ```rust
179 fn example() {
180     // If
181     foo!(if x {
182         foo();
183     } else {
184         bar();
185     });
186
187     // IfLet
188     foo!(if let Some(..) = x {
189         foo();
190     } else {
191         bar();
192     });
193
194     // While
195     foo!(while x {
196         foo();
197         bar();
198     });
199
200     // WhileLet
201     foo!(while let Some(..) = x {
202         foo();
203         bar();
204     });
205
206     // ForLoop
207     foo!(for x in y {
208         foo();
209         bar();
210     });
211
212     // Loop
213     foo!(loop {
214         foo();
215         bar();
216     });
217 }
218 ```
219
220 #### `false`
221
222 ```rust
223 ```
224
225 ## `comment_width`
226
227 Maximum length of comments. No effect unless`wrap_comments = true`.
228
229 - **Default value**: `80`
230 - **Possible values**: any positive integer
231
232 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
233
234 #### Comments shorter than `comment_width`:
235 ```rust
236 // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
237 ```
238
239 #### Comments longer than `comment_width`:
240 ```rust
241 // Lorem ipsum dolor sit amet,
242 // consectetur adipiscing elit.
243 ```
244
245 See also [`wrap_comments`](#wrap_comments).
246
247 ## `condense_wildcard_suffixes`
248
249 Replace strings of _ wildcards by a single .. in tuple patterns
250
251 - **Default value**: `false`
252 - **Possible values**: `true`, `false`
253
254 #### `false`:
255
256 ```rust
257 let (lorem, ipsum, _, _) = (1, 2, 3, 4);
258 ```
259
260 #### `true`:
261
262 ```rust
263 let (lorem, ipsum, ..) = (1, 2, 3, 4);
264 ```
265
266 ## `control_brace_style`
267
268 Brace style for control flow constructs
269
270 - **Default value**: `"AlwaysSameLine"`
271 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
272
273 #### `"AlwaysNextLine"`:
274
275 ```rust
276 if lorem
277 {
278     println!("ipsum!");
279 }
280 else
281 {
282     println!("dolor!");
283 }
284 ```
285
286 #### `"AlwaysSameLine"`:
287
288 ```rust
289 if lorem {
290     println!("ipsum!");
291 } else {
292     println!("dolor!");
293 }
294 ```
295
296 #### `"ClosingNextLine"`:
297
298 ```rust
299 if lorem {
300     println!("ipsum!");
301 }
302 else {
303     println!("dolor!");
304 }
305 ```
306
307 ## `disable_all_formatting`
308
309 Don't reformat anything
310
311 - **Default value**: `false`
312 - **Possible values**: `true`, `false`
313
314 ## `error_on_line_overflow`
315
316 Error if unable to get all lines within max_width
317
318 - **Default value**: `true`
319 - **Possible values**: `true`, `false`
320
321 See also [`max_width`](#max_width).
322
323 ## `fn_args_density`
324
325 Argument density in functions
326
327 - **Default value**: `"Tall"`
328 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
329
330 #### `"Compressed"`:
331
332 ```rust
333 trait Lorem {
334     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
335
336     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
337         // body
338     }
339
340     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
341              adipiscing: Adipiscing, elit: Elit);
342
343     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
344              adipiscing: Adipiscing, elit: Elit) {
345         // body
346     }
347 }
348 ```
349
350 #### `"CompressedIfEmpty"`:
351
352 ```rust
353 trait Lorem {
354     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
355
356     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
357         // body
358     }
359
360     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
361              adipiscing: Adipiscing, elit: Elit);
362
363     fn lorem(ipsum: Ipsum,
364              dolor: Dolor,
365              sit: Sit,
366              amet: Amet,
367              consectetur: onsectetur,
368              adipiscing: Adipiscing,
369              elit: Elit) {
370         // body
371     }
372 }
373 ```
374
375 #### `"Tall"`:
376
377 ```rust
378 trait Lorem {
379     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
380
381     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
382         // body
383     }
384
385     fn lorem(ipsum: Ipsum,
386              dolor: Dolor,
387              sit: Sit,
388              amet: Amet,
389              consectetur: onsectetur,
390              adipiscing: Adipiscing,
391              elit: Elit);
392
393     fn lorem(ipsum: Ipsum,
394              dolor: Dolor,
395              sit: Sit,
396              amet: Amet,
397              consectetur: onsectetur,
398              adipiscing: Adipiscing,
399              elit: Elit) {
400         // body
401     }
402 }
403 ```
404
405 #### `"Vertical"`:
406
407 ```rust
408 trait Lorem {
409     fn lorem(ipsum: Ipsum,
410              dolor: Dolor,
411              sit: Sit,
412              amet: Amet);
413
414     fn lorem(ipsum: Ipsum,
415              dolor: Dolor,
416              sit: Sit,
417              amet: Amet) {
418         // body
419     }
420
421     fn lorem(ipsum: Ipsum,
422              dolor: Dolor,
423              sit: Sit,
424              amet: Amet,
425              consectetur: onsectetur,
426              adipiscing: Adipiscing,
427              elit: Elit);
428
429     fn lorem(ipsum: Ipsum,
430              dolor: Dolor,
431              sit: Sit,
432              amet: Amet,
433              consectetur: onsectetur,
434              adipiscing: Adipiscing,
435              elit: Elit) {
436         // body
437     }
438 }
439 ```
440
441 ## `fn_args_layout`
442
443 Layout of function arguments and tuple structs
444
445 - **Default value**: `"Visual"`
446 - **Possible values**: `"Block"`, `"Visual"`
447
448 #### `"Block"`:
449
450 ```rust
451 fn lorem() {}
452
453 fn lorem(ipsum: usize) {}
454
455 fn lorem(
456     ipsum: usize,
457     dolor: usize,
458     sit: usize,
459     amet: usize,
460     consectetur: usize,
461     adipiscing: usize,
462     elit: usize,
463 ) {
464     // body
465 }
466 ```
467
468 #### `"Visual"`:
469
470 ```rust
471 fn lorem() {}
472
473 fn lorem(ipsum: usize) {}
474
475 fn lorem(ipsum: usize,
476          dolor: usize,
477          sit: usize,
478          amet: usize,
479          consectetur: usize,
480          adipiscing: usize,
481          elit: usize) {
482     // body
483 }
484 ```
485
486 ## `fn_args_paren_newline`
487
488 If function argument parenthesis goes on a newline
489
490 - **Default value**: `true`
491 - **Possible values**: `true`, `false`
492
493 #### `false`:
494
495 ```rust
496 fn lorem(
497     ipsum: Ipsum,
498     dolor: Dolor,
499     sit: Sit,
500     amet: Amet)
501     -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
502     // body
503 }
504 ```
505
506 #### `true`:
507
508 ```rust
509 fn lorem
510     (ipsum: Ipsum,
511      dolor: Dolor,
512      sit: Sit,
513      amet: Amet)
514      -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
515     // body
516 }
517 ```
518
519 ## `fn_brace_style`
520
521 Brace style for functions
522
523 - **Default value**: `"SameLineWhere"`
524 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
525
526 #### `"AlwaysNextLine"`:
527
528 ```rust
529 fn lorem()
530 {
531     // body
532 }
533
534 fn lorem(ipsum: usize)
535 {
536     // body
537 }
538
539 fn lorem<T>(ipsum: T)
540     where T: Add + Sub + Mul + Div
541 {
542     // body
543 }
544 ```
545
546 #### `"PreferSameLine"`:
547
548 ```rust
549 fn lorem() {
550     // body
551 }
552
553 fn lorem(ipsum: usize) {
554     // body
555 }
556
557 fn lorem<T>(ipsum: T)
558     where T: Add + Sub + Mul + Div {
559     // body
560 }
561 ```
562
563 #### `"SameLineWhere"`:
564
565 ```rust
566 fn lorem() {
567     // body
568 }
569
570 fn lorem(ipsum: usize) {
571     // body
572 }
573
574 fn lorem<T>(ipsum: T)
575     where T: Add + Sub + Mul + Div
576 {
577     // body
578 }
579 ```
580
581 ## `fn_call_style`
582
583 Indentation for function calls, etc.
584
585 - **Default value**: `"Visual"`
586 - **Possible values**: `"Block"`, `"Visual"`
587
588 #### `"Block"`:
589
590 ```rust
591 lorem(
592     "lorem",
593     "ipsum",
594     "dolor",
595     "sit",
596     "amet",
597     "consectetur",
598     "adipiscing",
599     "elit",
600 );
601 ```
602
603 #### `"Visual"`:
604
605 ```rust
606 lorem("lorem",
607       "ipsum",
608       "dolor",
609       "sit",
610       "amet",
611       "consectetur",
612       "adipiscing",
613       "elit");
614 ```
615
616 ## `fn_call_width`
617
618 Maximum width of the args of a function call before falling back to vertical formatting
619
620 - **Default value**: `60`
621 - **Possible values**: any positive integer
622
623 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
624
625 #### Function call shorter than `fn_call_width`:
626 ```rust
627 lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit");
628 ```
629
630 #### Function call longer than `fn_call_width`:
631
632 See [`fn_call_style`](#fn_call_style).
633
634 ## `fn_empty_single_line`
635
636 Put empty-body functions on a single line
637
638 - **Default value**: `true`
639 - **Possible values**: `true`, `false`
640
641 #### `false`:
642
643 ```rust
644 fn lorem() {
645 }
646 ```
647
648 #### `true`:
649
650 ```rust
651 fn lorem() {}
652 ```
653
654 See also [`control_brace_style`](#control_brace_style).
655
656 ## `fn_return_indent`
657
658 Location of return type in function declaration
659
660 - **Default value**: `"WithArgs"`
661 - **Possible values**: `"WithArgs"`, `"WithWhereClause"`
662
663 #### `"WithArgs"`:
664
665 ```rust
666 fn lorem(ipsum: Ipsum,
667          dolor: Dolor,
668          sit: Sit,
669          amet: Amet,
670          consectetur: Consectetur,
671          adipiscing: Adipiscing)
672          -> Elit
673     where Ipsum: Eq
674 {
675     // body
676 }
677
678 ```
679
680 #### `"WithWhereClause"`:
681
682 ```rust
683 fn lorem(ipsum: Ipsum,
684          dolor: Dolor,
685          sit: Sit,
686          amet: Amet,
687          consectetur: Consectetur,
688          adipiscing: Adipiscing)
689     -> Elit
690     where Ipsum: Eq
691 {
692     // body
693 }
694
695 ```
696
697 ## `fn_single_line`
698
699 Put single-expression functions on a single line
700
701 - **Default value**: `false`
702 - **Possible values**: `true`, `false`
703
704 #### `false`:
705
706 ```rust
707 fn lorem() -> usize {
708     42
709 }
710
711 fn lorem() -> usize {
712     let ipsum = 42;
713     ipsum
714 }
715 ```
716
717 #### `true`:
718
719 ```rust
720 fn lorem() -> usize { 42 }
721
722 fn lorem() -> usize {
723     let ipsum = 42;
724     ipsum
725 }
726 ```
727
728 See also [`control_brace_style`](#control_brace_style).
729
730 ## `force_explicit_abi`
731
732 Always print the abi for extern items
733
734 - **Default value**: `true`
735 - **Possible values**: `true`, `false`
736
737 **Note:** Non-"C" ABIs are always printed. If `false` then "C" is removed.
738
739 #### `false`:
740
741 ```rust
742 extern {
743     pub static lorem: c_int;
744 }
745 ```
746
747 #### `true`:
748
749 ```rust
750 extern "C" {
751     pub static lorem: c_int;
752 }
753 ```
754
755 ## `force_format_strings`
756
757 Always format string literals
758
759 - **Default value**: `false`
760 - **Possible values**: `true`, `false`
761
762 See [`format_strings`](#format_strings).
763
764 See also [`max_width`](#max_width).
765
766 ## `format_strings`
767
768 Format string literals where necessary
769
770 - **Default value**: `false`
771 - **Possible values**: `true`, `false`
772
773 #### `false`:
774
775 ```rust
776 let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
777 ```
778
779 #### `true`:
780
781 ```rust
782 let lorem =
783     "ipsum dolor sit amet consectetur \
784      adipiscing elit lorem ipsum dolor sit";
785 ```
786
787 See also [`force_format_strings`](#force_format_strings), [`max_width`](#max_width).
788
789 ## `generics_indent`
790
791 Indentation of generics
792
793 - **Default value**: `"Visual"`
794 - **Possible values**: `"Block"`, `"Visual"`
795
796 #### `"Block"`:
797
798 ```rust
799 fn lorem<
800     Ipsum: Eq = usize,
801     Dolor: Eq = usize,
802     Sit: Eq = usize,
803     Amet: Eq = usize,
804     Adipiscing: Eq = usize,
805     Consectetur: Eq = usize,
806     Elit: Eq = usize
807 >(ipsum: Ipsum,
808     dolor: Dolor,
809     sit: Sit,
810     amet: Amet,
811     adipiscing: Adipiscing,
812     consectetur: Consectetur,
813     elit: Elit)
814     -> T {
815     // body
816 }
817 ```
818
819 #### `"Visual"`:
820
821 ```rust
822 fn lorem<Ipsum: Eq = usize,
823          Dolor: Eq = usize,
824          Sit: Eq = usize,
825          Amet: Eq = usize,
826          Adipiscing: Eq = usize,
827          Consectetur: Eq = usize,
828          Elit: Eq = usize>
829     (ipsum: Ipsum,
830      dolor: Dolor,
831      sit: Sit,
832      amet: Amet,
833      adipiscing: Adipiscing,
834      consectetur: Consectetur,
835      elit: Elit)
836      -> T {
837     // body
838 }
839 ```
840
841 ## `hard_tabs`
842
843 Use tab characters for indentation, spaces for alignment
844
845 - **Default value**: `false`
846 - **Possible values**: `true`, `false`
847
848 #### `false`:
849
850 ```rust
851 fn lorem() -> usize {
852     42 // spaces before 42
853 }
854 ```
855
856 #### `true`:
857
858 ```rust
859 fn lorem() -> usize {
860         42 // tabs before 42
861 }
862 ```
863
864 See also: [`tab_spaces`](#tab_spaces).
865
866 ## `impl_empty_single_line`
867
868 Put empty-body implementations on a single line
869
870 - **Default value**: `true`
871 - **Possible values**: `true`, `false`
872
873 #### `false`:
874
875 ```rust
876 impl Lorem {
877 }
878 ```
879
880 #### `true`:
881
882 ```rust
883 impl Lorem {}
884 ```
885
886 See also [`item_brace_style`](#item_brace_style).
887
888 ## `indent_match_arms`
889
890 Indent match arms instead of keeping them at the same indentation level as the match keyword
891
892 - **Default value**: `true`
893 - **Possible values**: `true`, `false`
894
895 #### `false`:
896
897 ```rust
898 match lorem {
899 Lorem::Ipsum => (),
900 Lorem::Dolor => (),
901 Lorem::Sit => (),
902 Lorem::Amet => (),
903 }
904 ```
905
906 #### `true`:
907
908 ```rust
909 match lorem {
910     Lorem::Ipsum => (),
911     Lorem::Dolor => (),
912     Lorem::Sit => (),
913     Lorem::Amet => (),
914 }
915 ```
916
917 See also: [`match_block_trailing_comma`](#match_block_trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
918
919 ## `item_brace_style`
920
921 Brace style for structs and enums
922
923 - **Default value**: `"SameLineWhere"`
924 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
925
926 #### `"AlwaysNextLine"`:
927
928 ```rust
929 struct Lorem
930 {
931     ipsum: bool,
932 }
933
934 struct Dolor<T>
935     where T: Eq
936 {
937     sit: T,
938 }
939 ```
940
941 #### `"PreferSameLine"`:
942
943 ```rust
944 struct Lorem {
945     ipsum: bool,
946 }
947
948 struct Dolor<T>
949     where T: Eq {
950     sit: T,
951 }
952 ```
953
954 #### `"SameLineWhere"`:
955
956 ```rust
957 struct Lorem {
958     ipsum: bool,
959 }
960
961 struct Dolor<T>
962     where T: Eq
963 {
964     sit: T,
965 }
966 ```
967
968 ## `match_block_trailing_comma`
969
970 Put a trailing comma after a block based match arm (non-block arms are not affected)
971
972 - **Default value**: `false`
973 - **Possible values**: `true`, `false`
974
975 #### `false`:
976
977 ```rust
978 match lorem {
979     Lorem::Ipsum => {
980         println!("ipsum");
981     }
982     Lorem::Dolor => println!("dolor"),
983 }
984 ```
985
986 #### `true`:
987
988 ```rust
989 match lorem {
990     Lorem::Ipsum => {
991         println!("ipsum");
992     },
993     Lorem::Dolor => println!("dolor"),
994 }
995 ```
996
997 See also: [`indent_match_arms`](#indent_match_arms), [`trailing_comma`](#trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
998
999 ## `max_width`
1000
1001 Maximum width of each line
1002
1003 - **Default value**: `100`
1004 - **Possible values**: any positive integer
1005
1006 See also [`error_on_line_overflow`](#error_on_line_overflow).
1007
1008 ## `newline_style`
1009
1010 Unix or Windows line endings
1011
1012 - **Default value**: `"Unix"`
1013 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1014
1015 ## `normalize_comments`
1016
1017 Convert /* */ comments to // comments where possible
1018
1019 - **Default value**: `false`
1020 - **Possible values**: `true`, `false`
1021
1022 #### `false`:
1023
1024 ```rust
1025 // Lorem ipsum:
1026 fn dolor() -> usize {}
1027
1028 /* sit amet: */
1029 fn adipiscing() -> usize {}
1030 ```
1031
1032 #### `true`:
1033
1034 ```rust
1035 // Lorem ipsum:
1036 fn dolor() -> usize {}
1037
1038 // sit amet:
1039 fn adipiscing() -> usize {}
1040 ```
1041
1042 ## `reorder_imported_names`
1043
1044 Reorder lists of names in import statements alphabetically
1045
1046 - **Default value**: `false`
1047 - **Possible values**: `true`, `false`
1048
1049 #### `false`:
1050
1051 ```rust
1052 use super::{lorem, ipsum, dolor, sit};
1053 ```
1054
1055 #### `true`:
1056
1057 ```rust
1058 use super::{dolor, ipsum, lorem, sit};
1059 ```
1060
1061 See also [`reorder_imports`](#reorder_imports).
1062
1063 ## `reorder_imports`
1064
1065 Reorder import statements alphabetically
1066
1067 - **Default value**: `false`
1068 - **Possible values**: `true`, `false`
1069
1070 #### `false`:
1071
1072 ```rust
1073 use lorem;
1074 use ipsum;
1075 use dolor;
1076 use sit;
1077 ```
1078
1079 #### `true`:
1080
1081 ```rust
1082 use dolor;
1083 use ipsum;
1084 use lorem;
1085 use sit;
1086 ```
1087
1088 See also [`reorder_imported_names`](#reorder_imported_names), [`reorder_imports_in_group`](#reorder_imports_in_group).
1089
1090 ## `reorder_imports_in_group`
1091
1092 Reorder import statements in group
1093
1094 - **Default value**: `false`
1095 - **Possible values**: `true`, `false`
1096
1097 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1098
1099 #### `false`:
1100
1101 ```rust
1102 use std::mem;
1103 use std::io;
1104
1105 use lorem;
1106 use ipsum;
1107 use dolor;
1108 use sit;
1109 ```
1110
1111 #### `true`:
1112
1113 ```rust
1114 use std::io;
1115 use std::mem;
1116
1117 use dolor;
1118 use ipsum;
1119 use lorem;
1120 use sit;
1121 ```
1122
1123 See also [`reorder_imports`](#reorder_imports).
1124
1125 ## `single_line_if_else_max_width`
1126
1127 Maximum line length for single line if-else expressions.
1128
1129 - **Default value**: `50`
1130 - **Possible values**: any positive integer
1131
1132 **Note:** A value of `0` results in if-else expressions being broken regardless of their line's width.
1133
1134 #### Lines shorter than `single_line_if_else_max_width`:
1135 ```rust
1136 let lorem = if ipsum { dolor } else { sit };
1137 ```
1138
1139 #### Lines longer than `single_line_if_else_max_width`:
1140 ```rust
1141 let lorem = if ipsum {
1142     dolor
1143 } else {
1144     sit
1145 };
1146 ```
1147
1148 See also: [`control_brace_style`](#control_brace_style).
1149
1150 ## `skip_children`
1151
1152 Don't reformat out of line modules
1153
1154 - **Default value**: `false`
1155 - **Possible values**: `true`, `false`
1156
1157 ## `space_after_bound_colon`
1158
1159 Leave a space after the colon in a trait or lifetime bound
1160
1161 - **Default value**: `true`
1162 - **Possible values**: `true`, `false`
1163
1164 #### `false`:
1165
1166 ```rust
1167 fn lorem<T:Eq>(t: T) {
1168     // body
1169 }
1170 ```
1171
1172 #### `true`:
1173
1174 ```rust
1175 fn lorem<T: Eq>(t: T) {
1176     // body
1177 }
1178 ```
1179
1180 See also: [`space_before_bound`](#space_before_bound).
1181
1182 ## `space_after_struct_lit_field_colon`
1183
1184 Leave a space after the colon in a struct literal field
1185
1186 - **Default value**: `true`
1187 - **Possible values**: `true`, `false`
1188
1189 #### `false`:
1190
1191 ```rust
1192 let lorem = Lorem {
1193     ipsum:dolor,
1194     sit:amet,
1195 };
1196 ```
1197
1198 #### `true`:
1199
1200 ```rust
1201 let lorem = Lorem {
1202     ipsum: dolor,
1203     sit: amet,
1204 };
1205 ```
1206
1207 See also: [`space_before_struct_lit_field_colon`](#space_before_struct_lit_field_colon).
1208
1209 ## `space_after_type_annotation_colon`
1210
1211 Leave a space after the colon in a type annotation
1212
1213 - **Default value**: `true`
1214 - **Possible values**: `true`, `false`
1215
1216 #### `false`:
1217
1218 ```rust
1219 fn lorem<T: Eq>(t:T) {
1220     let ipsum:Dolor = sit;
1221 }
1222 ```
1223
1224 #### `true`:
1225
1226 ```rust
1227 fn lorem<T: Eq>(t: T) {
1228     let ipsum: Dolor = sit;
1229 }
1230 ```
1231
1232 See also: [`space_before_type_annotation`](#space_before_type_annotation).
1233
1234 ## `space_before_bound`
1235
1236 Leave a space before the colon in a trait or lifetime bound
1237
1238 - **Default value**: `false`
1239 - **Possible values**: `true`, `false`
1240
1241 #### `false`:
1242
1243 ```rust
1244 fn lorem<T: Eq>(t: T) {
1245     let ipsum: Dolor = sit;
1246 }
1247 ```
1248
1249 #### `true`:
1250
1251 ```rust
1252 fn lorem<T : Eq>(t: T) {
1253     let ipsum: Dolor = sit;
1254 }
1255 ```
1256
1257 See also: [`space_after_bound_colon`](#space_after_bound_colon).
1258
1259 ## `space_before_struct_lit_field_colon`
1260
1261 Leave a space before the colon in a struct literal field
1262
1263 - **Default value**: `true`
1264 - **Possible values**: `true`, `false`
1265
1266 #### `false`:
1267
1268 ```rust
1269 let lorem = Lorem {
1270     ipsum: dolor,
1271     sit: amet,
1272 };
1273 ```
1274
1275 #### `true`:
1276
1277 ```rust
1278 let lorem = Lorem {
1279     ipsum : dolor,
1280     sit : amet,
1281 };
1282 ```
1283
1284 See also: [`space_after_struct_lit_field_colon`](#space_after_struct_lit_field_colon).
1285
1286 ## `space_before_type_annotation`
1287
1288 Leave a space before the colon in a type annotation
1289
1290 - **Default value**: `false`
1291 - **Possible values**: `true`, `false`
1292
1293 #### `false`:
1294
1295 ```rust
1296 fn lorem<T: Eq>(t: T) {
1297     let ipsum: Dolor = sit;
1298 }
1299 ```
1300
1301 #### `true`:
1302
1303 ```rust
1304 fn lorem<T: Eq>(t : T) {
1305     let ipsum : Dolor = sit;
1306 }
1307 ```
1308
1309 See also: [`space_after_type_annotation_colon`](#space_after_type_annotation_colon).
1310
1311 ## `spaces_around_ranges`
1312
1313 Put spaces around the .. and ... range operators
1314
1315 - **Default value**: `false`
1316 - **Possible values**: `true`, `false`
1317
1318 #### `false`:
1319
1320 ```rust
1321 let lorem = 0..10;
1322 ```
1323
1324 #### `true`:
1325
1326 ```rust
1327 let lorem = 0 .. 10;
1328 ```
1329
1330 ## `spaces_within_angle_brackets`
1331
1332 Put spaces within non-empty generic arguments
1333
1334 - **Default value**: `false`
1335 - **Possible values**: `true`, `false`
1336
1337 #### `false`:
1338
1339 ```rust
1340 fn lorem<T: Eq>(t: T) {
1341     // body
1342 }
1343 ```
1344
1345 #### `true`:
1346
1347 ```rust
1348 fn lorem< T: Eq >(t: T) {
1349     // body
1350 }
1351 ```
1352
1353 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1354
1355 ## `spaces_within_parens`
1356
1357 Put spaces within non-empty parentheses
1358
1359 - **Default value**: `false`
1360 - **Possible values**: `true`, `false`
1361
1362 #### `false`:
1363
1364 ```rust
1365 fn lorem<T: Eq>(t: T) {
1366     let lorem = (ipsum, dolor);
1367 }
1368 ```
1369
1370 #### `true`:
1371
1372 ```rust
1373 fn lorem<T: Eq>( t: T ) {
1374     let lorem = ( ipsum, dolor );
1375 }
1376 ```
1377
1378 See also: [`spaces_within_angle_brackets`](#spaces_within_angle_brackets), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1379
1380 ## `spaces_within_square_brackets`
1381
1382 Put spaces within non-empty square brackets
1383
1384 - **Default value**: `false`
1385 - **Possible values**: `true`, `false`
1386
1387 #### `false`:
1388
1389 ```rust
1390 let lorem: [usize; 2] = [ipsum, dolor];
1391 ```
1392
1393 #### `true`:
1394
1395 ```rust
1396 let lorem: [ usize; 2 ] = [ ipsum, dolor ];
1397 ```
1398
1399 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_angle_brackets`](#spaces_within_angle_brackets).
1400
1401 ## `struct_lit_multiline_style`
1402
1403 Multiline style on literal structs
1404
1405 - **Default value**: `"PreferSingle"`
1406 - **Possible values**: `"ForceMulti"`, `"PreferSingle"`
1407
1408 #### `"ForceMulti"`:
1409
1410 ```rust
1411 let lorem = Lorem {
1412     ipsum: dolor,
1413     sit: amet,
1414 };
1415 ```
1416
1417 #### `"PreferSingle"`:
1418
1419 ```rust
1420 let lorem = Lorem { ipsum: dolor, sit: amet };
1421 ```
1422
1423 See also: [`struct_lit_style`](#struct_lit_style), [`struct_lit_width`](#struct_lit_width).
1424
1425 ## `struct_lit_style`
1426
1427 Style of struct definition
1428
1429 - **Default value**: `"Block"`
1430 - **Possible values**: `"Block"`, `"Visual"`
1431
1432 #### `"Block"`:
1433
1434 ```rust
1435 let lorem = Lorem {
1436     ipsum: dolor,
1437     sit: amet,
1438 };
1439 ```
1440
1441 #### `"Visual"`:
1442
1443 ```rust
1444 let lorem = Lorem { ipsum: dolor,
1445                     sit: amet, };
1446 ```
1447
1448 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1449
1450 ## `struct_lit_width`
1451
1452 Maximum width in the body of a struct lit before falling back to vertical formatting
1453
1454 - **Default value**: `18`
1455 - **Possible values**: any positive integer
1456
1457 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1458
1459 #### Lines shorter than `struct_lit_width`:
1460 ```rust
1461 let lorem = Lorem { ipsum: dolor, sit: amet };
1462 ```
1463
1464 #### Lines longer than `struct_lit_width`:
1465 See [`struct_lit_style`](#struct_lit_style).
1466
1467 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1468
1469 ## `struct_variant_width`
1470
1471 Maximum width in the body of a struct variant before falling back to vertical formatting
1472
1473 - **Default value**: `35`
1474 - **Possible values**: any positive integer
1475
1476 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1477
1478 #### Struct variants shorter than `struct_variant_width`:
1479 ```rust
1480 enum Lorem {
1481     Ipsum,
1482     Dolor(bool),
1483     Sit { amet: Consectetur, adipiscing: Elit },
1484 }
1485 ```
1486
1487 #### Struct variants longer than `struct_variant_width`:
1488 ```rust
1489 enum Lorem {
1490     Ipsum,
1491     Dolor(bool),
1492     Sit {
1493         amet: Consectetur,
1494         adipiscing: Elit,
1495     },
1496 }
1497 ```
1498
1499 ## `tab_spaces`
1500
1501 Number of spaces per tab
1502
1503 - **Default value**: `4`
1504 - **Possible values**: any positive integer
1505
1506 #### `2`:
1507
1508 ```rust
1509 fn lorem() {
1510   let ipsum = dolor();
1511   let sit = vec![
1512     "amet consectetur adipiscing elit."
1513   ];
1514 }
1515 ```
1516
1517 #### `4`:
1518
1519 ```rust
1520 fn lorem() {
1521     let ipsum = dolor();
1522     let sit = vec![
1523         "amet consectetur adipiscing elit."
1524     ];
1525 }
1526 ```
1527
1528 See also: [`hard_tabs`](#hard_tabs).
1529
1530 ## `take_source_hints`
1531
1532 Retain some formatting characteristics from the source code
1533
1534 - **Default value**: `false`
1535 - **Possible values**: `true`, `false`
1536
1537 #### `false`:
1538
1539 ```rust
1540 lorem
1541     .ipsum()
1542     .dolor(|| { sit.amet().consectetur().adipiscing().elit(); });
1543 ```
1544
1545 #### `true`:
1546
1547 ```rust
1548 lorem
1549     .ipsum()
1550     .dolor(|| {
1551                sit.amet()
1552                    .consectetur()
1553                    .adipiscing()
1554                    .elit();
1555            });
1556 ```
1557
1558 Note: This only applies if the call chain within the inner closure had already been formatted on separate lines before running rustfmt.
1559
1560 ## `trailing_comma`
1561
1562 How to handle trailing commas for lists
1563
1564 - **Default value**: `"Vertical"`
1565 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1566
1567 #### `"Always"`:
1568
1569 ```rust
1570 let Lorem { ipsum, dolor, sit, } = amet;
1571 let Lorem {
1572     ipsum,
1573     dolor,
1574     sit,
1575     amet,
1576     consectetur,
1577     adipiscing,
1578 } = elit;
1579 ```
1580
1581 #### `"Never"`:
1582
1583 ```rust
1584 let Lorem { ipsum, dolor, sit } = amet;
1585 let Lorem {
1586     ipsum,
1587     dolor,
1588     sit,
1589     amet,
1590     consectetur,
1591     adipiscing
1592 } = elit;
1593 ```
1594
1595 #### `"Vertical"`:
1596
1597 ```rust
1598 let Lorem { ipsum, dolor, sit } = amet;
1599 let Lorem {
1600     ipsum,
1601     dolor,
1602     sit,
1603     amet,
1604     consectetur,
1605     adipiscing,
1606 } = elit;
1607 ```
1608
1609 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1610
1611 ## `type_punctuation_density`
1612
1613 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1614
1615 - **Default value**: `"Wide"`
1616 - **Possible values**: `"Compressed"`, `"Wide"`
1617
1618 #### `"Compressed"`:
1619
1620 ```rust
1621 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1622         // body
1623 }
1624 ```
1625
1626 #### `"Wide"`:
1627
1628 ```rust
1629 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1630         // body
1631 }
1632 ```
1633
1634 ## `use_try_shorthand`
1635
1636 Replace uses of the try! macro by the ? shorthand
1637
1638 - **Default value**: `false`
1639 - **Possible values**: `true`, `false`
1640
1641 #### `false`:
1642
1643 ```rust
1644 let lorem = try!(ipsum.map(|dolor|dolor.sit()));
1645 ```
1646
1647 #### `true`:
1648
1649 ```rust
1650 let lorem = ipsum.map(|dolor| dolor.sit())?;
1651 ```
1652
1653 ## `where_density`
1654
1655 Density of a where clause
1656
1657 - **Default value**: `"CompressedIfEmpty"`
1658 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
1659
1660 #### `"Compressed"`:
1661
1662 ```rust
1663 trait Lorem {
1664     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
1665
1666     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq {
1667         // body
1668     }
1669 }
1670 ```
1671
1672 #### `"CompressedIfEmpty"`:
1673
1674 ```rust
1675 trait Lorem {
1676     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
1677
1678     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1679         where Dolor: Eq
1680     {
1681         // body
1682     }
1683 }
1684 ```
1685
1686 #### `"Tall"`:
1687
1688 ```rust
1689 trait Lorem {
1690     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1691         where Dolor: Eq;
1692
1693     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1694         where Dolor: Eq
1695     {
1696         // body
1697     }
1698 }
1699 ```
1700
1701 **Note:** `where_density = "Tall"` currently produces the same output as `where_density = "Vertical"`.
1702
1703 #### `"Vertical"`:
1704
1705 ```rust
1706 trait Lorem {
1707     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1708         where Dolor: Eq;
1709
1710     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1711         where Dolor: Eq
1712     {
1713         // body
1714     }
1715 }
1716 ```
1717
1718 **Note:** `where_density = "Vertical"` currently produces the same output as `where_density = "Tall"`.
1719
1720 See also: [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1721
1722 ## `where_layout`
1723
1724 Element layout inside a where clause
1725
1726 - **Default value**: `"Vertical"`
1727 - **Possible values**: `"Horizontal"`, `"HorizontalVertical"`, `"Mixed"`, `"Vertical"`
1728
1729 #### `"Horizontal"`:
1730
1731 ```rust
1732 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1733     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1734 {
1735     // body
1736 }
1737
1738 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1739     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1740 {
1741     // body
1742 }
1743 ```
1744
1745 #### `"HorizontalVertical"`:
1746
1747 ```rust
1748 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1749     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1750 {
1751     // body
1752 }
1753
1754 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1755     where Ipsum: IpsumDolorSitAmet,
1756           Dolor: DolorSitAmetConsectetur,
1757           Sit: SitAmetConsecteturAdipiscing,
1758           Amet: AmetConsecteturAdipiscingElit
1759 {
1760     // body
1761 }
1762 ```
1763
1764 #### `"Mixed"`:
1765
1766 ```rust
1767 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1768     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1769 {
1770     // body
1771 }
1772
1773 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1774     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
1775           Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1776 {
1777     // body
1778 }
1779 ```
1780
1781 #### `"Vertical"`:
1782
1783 ```rust
1784 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1785     where Ipsum: IpsumDolorSitAmet,
1786           Dolor: DolorSitAmetConsectetur
1787 {
1788     // body
1789 }
1790
1791 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1792     where Ipsum: IpsumDolorSitAmet,
1793           Dolor: DolorSitAmetConsectetur,
1794           Sit: SitAmetConsecteturAdipiscing,
1795           Amet: AmetConsecteturAdipiscingElit
1796 {
1797     // body
1798 }
1799 ```
1800
1801 See also: [`where_density`](#where_density), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1802
1803 ## `where_pred_indent`
1804
1805 Indentation style of a where predicate
1806
1807 - **Default value**: `"Visual"`
1808 - **Possible values**: `"Block"`, `"Visual"`
1809
1810 #### `"Block"`:
1811
1812 ```rust
1813 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1814     where Ipsum: Eq,
1815         Dolor: Eq,
1816         Sit: Eq,
1817         Amet: Eq
1818 {
1819     // body
1820 }
1821 ```
1822
1823 #### `"Visual"`:
1824
1825 ```rust
1826 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1827     where Ipsum: Eq,
1828           Dolor: Eq,
1829           Sit: Eq,
1830           Amet: Eq
1831 {
1832     // body
1833 }
1834 ```
1835
1836 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_style`](#where_style).
1837
1838 ## `where_style`
1839
1840 Overall strategy for where clauses
1841
1842 - **Default value**: `"Default"`
1843 - **Possible values**: `"Default"`, `"Rfc"`
1844
1845 #### `"Default"`:
1846
1847 ```rust
1848 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1849     where Ipsum: Eq,
1850           Dolor: Eq,
1851           Sit: Eq,
1852           Amet: Eq
1853 {
1854     // body
1855 }
1856 ```
1857
1858 #### `"Rfc"`:
1859
1860 ```rust
1861 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1862 where
1863     Ipsum: Eq,
1864     Dolor: Eq,
1865     Sit: Eq,
1866     Amet: Eq,
1867 {
1868     // body
1869 }
1870 ```
1871
1872 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent).
1873
1874 ## `wrap_comments`
1875
1876 Break comments to fit on the line
1877
1878 - **Default value**: `false`
1879 - **Possible values**: `true`, `false`
1880
1881 #### `false`:
1882
1883 ```rust
1884 // 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.
1885 ```
1886
1887 #### `true`:
1888
1889 ```rust
1890 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
1891 // sed do eiusmod tempor incididunt ut labore et dolore
1892 // magna aliqua. Ut enim ad minim veniam, quis nostrud
1893 // exercitation ullamco laboris nisi ut aliquip ex ea
1894 // commodo consequat.
1895 ```
1896
1897 ## `wrap_match_arms`
1898
1899 Wrap multiline match arms in blocks
1900
1901 - **Default value**: `true`
1902 - **Possible values**: `true`, `false`
1903
1904 #### `false`:
1905
1906 ```rust
1907 match lorem {
1908     true => {
1909         let ipsum = dolor;
1910         println!("{}", ipsum);
1911     }
1912     false => {
1913         println!("{}", sit)
1914     }
1915 }
1916 ```
1917
1918 #### `true`:
1919
1920 ```rust
1921 match lorem {
1922     true => {
1923         let ipsum = dolor;
1924         println!("{}", ipsum);
1925     }
1926     false => println!("{}", sit),
1927 }
1928 ```
1929
1930 See also: [`indent_match_arms`](#indent_match_arms), [`match_block_trailing_comma`](#match_block_trailing_comma).
1931
1932 ## `write_mode`
1933
1934 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
1935
1936 - **Default value**: `"Replace"`
1937 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`