Nick Cameron
bf9f175336
reviewer comments and rebase fallout
2018-03-20 09:27:31 +13:00
Nick Cameron
50c95a074a
cargo fmt
2018-03-20 09:27:31 +13:00
topecongiro
3999d64f12
Simplify IgnoreList
2018-03-12 08:41:19 +09:00
Seiichi Uchida
84ad70c151
Add ignore config option
...
For example, with the following config file, rustfmt will ignore `src/types.rs`,
`src/foo/bar.rs` and every file under `examples/` directory.
```toml
[ignore]
files = [
"src/types.rs",
"src/foo/bar.rs",
]
directories = [
"examples",
]
```
2018-03-09 13:37:52 +09:00
David Lukes
53347bc226
Add license_template_path configuration snippet
2018-03-05 13:19:46 +01:00
topecongiro
34f6408ea2
Update Configurations.md
2018-02-23 21:55:16 +09:00
David Alber
7739cf8f46
Modifying reorder_extern_crates
example to show effect on groups
2018-02-19 22:32:44 -08:00
David Alber
00cab7e74c
Fixing the documentation for reorder_extern_crates_in_group
2018-02-19 22:32:44 -08:00
David Alber
73b13e0abe
Using shorter example for struct_lit_single_line
option
2018-02-18 23:17:36 -08:00
David Alber
f2bed291ba
Fixing command-line option name
2018-02-12 21:48:57 -08:00
David Alber
429dad72b6
Formatting snippets without configuration option marked as skip
2018-02-12 08:17:43 -08:00
David Alber
d4a518dc0a
Fixing control flow examples
2018-02-11 14:48:45 -08:00
Nick Cameron
b7f01769f9
Merge branch 'master' into init-shorthand
2018-02-01 15:20:01 +13:00
Seiichi Uchida
c9c346a89f
Add 'use_field_init_shorthand' config option
2018-01-29 22:15:20 +09:00
David Alber
476ec77fa3
Wrapping match_arm_blocks=false
snippet in function
2018-01-25 21:05:19 -08:00
David Alber
42efa7cc2f
Wrapping match_arm_blocks=true
snippet in function
2018-01-25 21:05:19 -08:00
David Alber
d27393528c
Fixing use_try_shorthand=true
snippet
2018-01-25 21:05:19 -08:00
David Alber
90c3ea716a
Fixing use_try_shorthand=false
snippet
2018-01-25 21:05:19 -08:00
David Alber
4315e3d968
Fixing type_punctuation_density=Compressed
snippet
2018-01-25 21:05:19 -08:00
David Alber
dab8f4991d
Fixing type_punctuation_density=Wide
snippet
2018-01-25 21:05:19 -08:00
David Alber
61630bc6f5
Wrapping trailing_comma=Never
snippet in function
2018-01-25 21:05:19 -08:00
David Alber
6c92808060
Wrapping trailing_comma=Always
snippet in function
2018-01-25 21:05:19 -08:00
David Alber
99ae6b8d1f
Wrapping trailing_comma=Vertical
snippet in function
2018-01-25 21:05:19 -08:00
David Alber
9d696a94e6
Fixing tab_spaces=2
snippet
2018-01-25 21:05:19 -08:00
David Alber
e5cdf0e9fd
Fixing tab_spaces=4
snippet
2018-01-25 21:05:19 -08:00
David Alber
fdd126a36e
Wrapping struct_lit_single_line=false
snippet in function
2018-01-25 21:05:19 -08:00
David Alber
33b5c3f9d5
Fixing spaces_within_parens_and_brackets=true
snippet
2018-01-25 21:05:19 -08:00
David Alber
9a9bb8564b
Fixing spaces_within_parens_and_brackets=false
snippet
2018-01-25 21:05:19 -08:00
David Alber
8d0497bf83
Fixing force_multiline_blocks=true
snippet
2018-01-25 21:02:18 -08:00
David Alber
f624f6b5a6
Fixing force_multiline_blocks=false
snippet
2018-01-25 21:02:18 -08:00
Seiichi Uchida
a19e1c0b83
Merge pull request #2369 from davidalber/fix-configuration-snippets
...
Fixing straightforward configuration snippets (Part 1)
2018-01-26 12:35:04 +09:00
David Alber
69f27673df
Extending spaces_around_ranges
to ranges in match arm patterns
2018-01-21 16:50:17 -08:00
David Alber
2afd1eada3
Wrapping match_block_trailing_comma=true
snippet in function
2018-01-16 08:12:32 -08:00
David Alber
44d2fcc2a0
Wrapping match_block_trailing_comma=false
snippet in function
2018-01-16 08:12:32 -08:00
David Alber
ee9bdeed7d
Fixing imports_layout="HorizontalVertical"
snippet
2018-01-16 08:12:32 -08:00
David Alber
e49314fccc
Fixing imports_layout="Mixed"
snippet
2018-01-16 08:12:32 -08:00
David Alber
c92a3b4066
Fixing imports_indent="Block"
snippet
2018-01-16 08:12:32 -08:00
David Alber
167ed92a24
Fixing imports_indent="Visual"
snippet
2018-01-16 08:12:32 -08:00
David Alber
df9cbb92bd
Fixing format_strings=true
snippet
2018-01-16 08:12:31 -08:00
David Alber
30f89c3063
Fixing format_strings=false
snippet
2018-01-16 08:12:31 -08:00
David Alber
ed90b2232f
Fixing where_single_line=true
snippet
2018-01-16 08:12:31 -08:00
David Alber
76947a68d3
Fixing where_single_line=false
snippet
2018-01-16 08:12:31 -08:00
David Alber
45deeee80f
Fixing brace_style="PreferSameLine"
structs and enums snippet
2018-01-16 08:12:31 -08:00
David Alber
034bd7a88e
Fixing brace_style="AlwaysNextLine"
structs and enums snippet
2018-01-16 08:12:31 -08:00
David Alber
4db479f637
Fixing brace_style="SameLineWhere"
structs and enums snippet
2018-01-16 08:12:31 -08:00
David Alber
514adeb156
Getting fn_args_density="Vertical"
snippet to pass
2018-01-16 08:12:31 -08:00
David Alber
7e7370756c
Wrapping control_brace_style="ClosingNextLine"
snippet in function
2018-01-16 08:12:31 -08:00
David Alber
ba7f3ab718
Wrapping control_brace_style="AlwaysNextLine"
snippet in function
2018-01-16 08:12:31 -08:00
David Alber
d49e22a2b8
Wrapping control_brace_style="AlwaysSameLine"
snippet in function
2018-01-16 08:12:31 -08:00
David Alber
368a44b564
Wrapping condense_wildcard_suffixes=true
snippet in function
2018-01-16 08:12:31 -08:00
David Alber
c08c706f55
Wrapping condense_wildcard_suffixes=false
snippet in function
2018-01-16 08:12:31 -08:00
David Alber
8b010c30fc
Getting binop_separator="Front"
snippet to pass
2018-01-16 08:12:31 -08:00
David Alber
b23204fc54
Correcting use_small_heuristics=true
snippet
2018-01-16 08:12:31 -08:00
David Alber
3a7eb68db9
Correcting indent_style="Block"
where predicate snippet
2018-01-16 08:12:31 -08:00
David Alber
e2ffee7cf8
Wrapping indent_style="Visual"
struct snippet in function
2018-01-16 08:12:31 -08:00
David Alber
c6a18143a8
Wrapping indent_style="Block"
struct snippet in function
2018-01-16 08:12:31 -08:00
David Alber
b56d88f751
Correcting indent_style="Visual"
generics snippet
2018-01-16 08:12:31 -08:00
David Alber
2455d60718
Correcting indent_style="Block"
generics snippet
2018-01-16 08:12:31 -08:00
David Alber
5180df4988
Wrapping indent_style="Visual"
function call snippet in function
2018-01-16 08:12:31 -08:00
David Alber
9fc00aa794
Wrapping indent_style="Block"
function call snippet in function
2018-01-16 08:12:31 -08:00
David Alber
48d7fb2db0
Wrapping indent_style="Visual"
array snippet in function
2018-01-16 08:12:31 -08:00
David Alber
5673c0fdbf
Wrapping indent_style="Block"
array snippet in function
2018-01-16 08:12:31 -08:00
Seiichi Uchida
c87bd9e92e
Merge pull request #2367 from Stinners/range_binopts
...
Fixing binop_separator="Back" for ranges (Issue #2364 )
2018-01-16 17:52:09 +09:00
David Alber
790611cd82
Restoring characters accidentally removed in bbe4b380
2018-01-15 20:57:28 -08:00
Chris Stinson
4c4e079613
Fixing binop_separator="Back" for ranges
...
Hardcoded Separator::Place=Front in call to rewrite_pair for range
caused binop_separator="Back" to be hendled incorrectly
Fixed rewrite_pair call and the example in Configuration.md showing
the faulty behaviour
2018-01-16 17:50:20 +13:00
Nick Cameron
13a0bb9158
Merge pull request #2361 from davidalber/fix-binop-separator-back-snippet
...
Getting `binop_separator="Back"` snippet in Configurations.md to pass
2018-01-16 13:01:02 +13:00
David Alber
bbe4b380c3
Getting binop_separator="Back"
to pass
2018-01-15 10:47:35 -08:00
David Alber
49f418b838
Rewording configuration note
2018-01-15 01:41:11 -08:00
Seiichi Uchida
279acda4c4
Remove same_line_attributes config option
2018-01-11 16:52:28 +09:00
David Alber
85ccb98469
Adding test to verify code block idempotency in Configurations.md
2018-01-04 00:01:18 -08:00
Lukas Kalbertodt
5de87bdbc0
Add options blank_lines_{lower|upper}_bound
to Configurations.md
2018-01-02 21:54:58 +01:00
Christopher Durham
dcd6ed7d5e
Remove reference to env var
...
The check was moved to compile time and was not intended to be user-facing
2017-12-16 21:05:24 -05:00
Christopher Durham
e18401ca01
Remove chain_indent
2017-12-16 21:03:51 -05:00
Christopher Durham
9ac1e6d978
Add configuration stability information
2017-12-16 21:03:51 -05:00
Clément Delafargue
3be1cb64a8
Fix format for spaces_around_ranges
example
2017-12-06 11:19:23 +01:00
Kevin Choubacha
60e8af59a0
Combine 3 repeated sections into a single section
2017-12-02 15:23:07 -08:00
Deepak Thukral
188acd9ffc
docs: fixes incorrect output
2017-11-30 14:48:29 +01:00
Deepak Thukral
73afe562f1
docs: Adds where_single_line in configuration documentation
2017-11-30 13:01:41 +01:00
Nick Cameron
f0af1d4818
Remove CompressedIfEmpty option from fn_args_density
...
It was identical to Tall
2017-11-27 17:49:55 +13:00
Nick Cameron
677446e99d
Merge fn_empty_single_line and impl_empty_single_line into empty_item_single_line
2017-11-27 17:46:09 +13:00
Nick Cameron
9a33255834
Rename wrap_match_arms to match_arm_blocks
2017-11-27 17:35:27 +13:00
Nick Cameron
8f4d85a9d7
Merge multiline_closure_forces_block and multiline_match_arm_forces_block into force_multiline_block
2017-11-27 17:03:54 +13:00
Nick Cameron
087f8b5854
Remove match_arm_forces_newline
2017-11-27 16:31:49 +13:00
Nick Cameron
0e1fa2c244
Remove indent_match_arms
2017-11-27 15:49:14 +13:00
Nick Cameron
86007e7d17
Remove where_density
and where_layout
options
...
There is a choice between block and visual indent for where clauses, plus the
single line option. I think these two are too fine-grained to be useful.
2017-11-24 21:08:24 +13:00
Nick Cameron
dd1fbca99a
Replace various small width heuristics with a single option
...
Closes #1984
2017-11-24 20:17:06 +13:00
Nick Cameron
45d4f7a2dd
struct_lit_multiline_style -> struct_lit_single_line (and make it a bool)
2017-11-24 14:45:18 +13:00
Nick Cameron
20805acf42
Merge attributes_on_same_line_as_field
and attributes_on_same_line_as_variant
into same_line_attributes
2017-11-24 14:29:44 +13:00
Nick Cameron
d00c60df5c
Remove chain_split_single_child
option
2017-11-24 14:12:54 +13:00
Nick Cameron
4cb474b5ee
Remove force_format_strings
in favour of format_strings
2017-11-24 14:07:37 +13:00
Nick Cameron
8a7b6b8806
Remove match_pattern_separator_break_point
in favour of binop_separator
2017-11-24 14:01:44 +13:00
Nick Cameron
179b3c59de
Remove legacy option fn_args_paren_newline
2017-11-24 13:27:14 +13:00
Nick Cameron
4f65124422
Remove legacy option fn_return_indent
2017-11-24 13:19:36 +13:00
Nick Cameron
d0f12b8ec8
Remove unused option take_source_hints
2017-11-24 13:08:02 +13:00
Dirkjan Ochtman
f52dbd5c5e
Fix typo in Configurations docs
2017-11-19 21:14:54 +01:00
topecongiro
4e7c2756d3
Update Configurations.md
2017-11-14 23:47:30 +09:00
topecongiro
707a296377
Update Configurations.md
2017-11-14 10:49:18 +09:00
topecongiro
9a58741f29
Remove duplicated 'indent_style' section
2017-11-14 09:31:50 +09:00
topecongiro
f3aba5d1df
Update Configurations.md
2017-11-13 17:33:32 +09:00
Nick Cameron
e6800bf27d
remove closure_block_indent_threshold option
2017-11-13 15:40:54 +13:00
David Alber
f8eedcba5f
Adding an example for combine_control_expr = false
...
Fixes #2132 .
2017-11-12 10:16:19 -08:00
David Alber
72f77eaf47
Updating where_density = "Vertical"
example
...
The example for `where_density = "Vertical"` does not match the
current output from rustfmt. This change corrects that.
Fixes #2133 .
2017-11-12 00:16:24 -08:00
Ben Boeckel
523fc086c7
Configurations: document report_todo and report_fixme
2017-11-09 14:11:33 -05:00
Ben Boeckel
fcdd01989d
Configurations: document reorder_extern_crates settings
2017-11-09 14:11:33 -05:00
Ben Boeckel
33a2bc9d3f
Configurations: document error_on_line_overflow_comments
2017-11-09 14:11:33 -05:00
Ben Boeckel
4d547b38a7
Configurations: fix where_density documentation
...
The default is actually `Vertical`.
2017-11-09 14:11:33 -05:00
Ben Boeckel
1bb927e46f
Configurations: add colons to example section titles
2017-11-09 14:11:33 -05:00
Ben Boeckel
6447e0d072
Configurations: markup max_width
2017-11-09 14:10:37 -05:00
Nick Cameron
f1035d9782
Merge pull request #2116 from topecongiro/config-options-indent
...
Rename config options related to indent
2017-11-06 08:43:12 +13:00
topecongiro
40c5666af6
Rename 'struct_lit_style' to 'struct_lit_indent'
2017-11-04 22:47:28 +09:00
topecongiro
d5d8740993
Rename 'fn_call_style' to 'fn_call_indent'
2017-11-04 22:46:40 +09:00
topecongiro
55c2000d94
Rename 'fn_args_layout' to 'fn_args_indent'
2017-11-04 22:45:47 +09:00
topecongiro
5096cdff56
Rename 'array_layout' to 'array_indent'
2017-11-04 22:45:09 +09:00
topecongiro
d287b06eba
Rename 'chain_one_line_max' to 'chain_width'
2017-11-04 22:24:43 +09:00
Martin Lindhe
f930a16b8d
fix some typos
2017-11-01 07:33:55 +01:00
Ömer Sinan Ağacan
48bdecf99d
Add Configurations.md section
2017-10-27 08:25:14 +03:00
Saulo Silva
131a37591d
Show examples of default values first and annotate them with "(default)"
2017-09-18 21:28:51 -04:00
topecongiro
bc56e7b710
Add visual guide for binop_separator
2017-09-15 15:10:34 +09:00
topecongiro
669a139956
Only merge consecutive derives
2017-08-24 23:48:18 +09:00
topecongiro
5dafcc24e4
Add merge_derives config option
2017-08-24 22:29:56 +09:00
Michael Smith
411c73c12f
Add multiline_{closure,match_arm}_forces_block
...
multiline_closure_forces_block = false (default):
result.and_then(|maybe_value| match maybe_value {
None => ...,
Some(value) => ...,
})
multiline_closure_forces_block = true:
result.and_then(|maybe_value| {
match maybe_value {
None => ...,
Some(value) => ...,
}
})
multiline_match_arm_forces_block = false (default):
match lorem {
None => if ipsum {
println!("Hello World");
},
Some(dolor) => ...,
}
multiline_match_arm_forces_block = true:
match lorem {
None => {
if ipsum {
println!("Hello World");
}
}
Some(dolor) => ...,
}
2017-08-21 14:05:20 -07:00
Nick Cameron
7e171836c6
Merge pull request #1900 from spinda/attributes-on-same-line
...
Add attributes_on_same_line_as_{field,variant} configs
2017-08-21 11:26:36 +12:00
Michael Smith
1c9d044c05
Add attributes_on_same_line_as_{field,variant}
2017-08-19 15:09:10 -07:00
Seiichi Uchida
a3567cec94
Add mach_pattern_separator_break_point config option
2017-08-18 23:19:11 +09:00
Seiichi Uchida
e9199fd25e
Update visual guide
2017-08-15 22:10:55 +09:00
Nick Cameron
6984c05e69
Change the writemode to overwrite
2017-07-21 11:22:51 +12:00
topecongiro
988e387132
Add imports_indent and imports_layout config options
2017-07-14 09:18:28 +09:00
topecongiro
2fb66cd1d3
Add trailing_semicolon config option
...
trailing_semicolon controls whether to add a trailing semicolon after break,
continue and return.
2017-07-12 14:16:06 +09:00
topecongiro
c11aac04a3
Update wrap_match_arms option tests and visual guide
2017-07-11 21:53:57 +09:00
topecongiro
8e8e7a4215
Add array_horizontal_layout_threshold option
2017-07-06 01:19:36 +09:00
topecongiro
34b4a9d3c4
Add struct_field_align_threshold for vertical alignment
2017-07-03 18:54:41 +09:00
Phil Ellison
55c2e3b1a4
Fix control_style example
2017-06-19 19:43:38 +01:00
Phil Ellison
ba36bbcfe2
Document control_style in Configurations.md
2017-06-18 10:37:05 +01:00
Phil Ellison
40db2af18e
Update names on where_style code snippets
2017-06-18 09:34:24 +01:00
Phil Ellison
e9c81cd537
Fix names of possible values for where_style
2017-06-18 08:33:32 +01:00
Phil Ellison
c0804f8a55
Fix defaults in Configurations.md
2017-06-17 11:22:04 +01:00
Seiichi Uchida
41ca11193d
Fix Configurations.md
2017-06-10 22:23:09 +09:00
Nick Cameron
6a9d7dab0d
Merge pull request #1637 from est31/master
...
Add config options for spaces around the colon in struct literal fields
2017-06-06 16:20:16 +12:00
est31
aa4cd311bb
Add config options for spaces around the colon in struct literal fields
...
In Rust, colons are used for three purposes:
* Type annotations, including type ascription
* Trait bounds
* Struct literal fields
This commit adds options for the last missing of the three purposes,
struct literal fields.
2017-06-06 03:50:58 +02:00
topecongiro
4a0094f28f
Add combine_control_expr option
2017-06-04 19:35:29 +09:00
topecongiro
2580d7a310
Add chain_split_single_child option
2017-05-25 16:07:56 +09:00
Nick Cameron
fdf950b009
Merge pull request #1569 from mathstuf/example-typos
...
Configurations: fix typos in example signatures
2017-05-19 11:57:44 +12:00
Ben Boeckel
59cefa988a
Configurations: fix typos in example signatures
2017-05-18 08:17:09 -04:00
Ben Boeckel
8ca699ce26
config: fix suffices
-> suffixes
typo
...
Fixes #1477 .
2017-05-18 08:03:47 -04:00
Flier Lu
1077a100a1
reorder imports in group
2017-05-18 13:26:34 +08:00
Vincent Esche
c994d4e9d7
Add visual configurations guide.
2017-05-01 23:55:18 +02:00