topecongiro
5096cdff56
Rename 'array_layout' to 'array_indent'
2017-11-04 22:45:09 +09:00
Nick Cameron
9bf81f9d12
Remove LicensePolicy (dead code)
...
Fixes #1320
2017-11-03 08:43:33 +13:00
Martin Lindhe
f930a16b8d
fix some typos
2017-11-01 07:33:55 +01:00
Tarin Mahmood
685c9d332f
Unstable options added
2017-10-28 16:26:33 +06:00
Ömer Sinan Ağacan
abf8f43233
Implement match_arm_forces_newline option ( #2039 )
2017-10-26 20:20:36 +03:00
Douglas Anderson
ac33472d36
Fix typo in --config-help "funciton" -> "function"
2017-10-22 00:47:45 -06:00
Jorge Aparicio
77584e507c
default required-version to the current rustfmt version
2017-10-10 22:37:47 +02:00
Jorge Aparicio
0c36c59175
add required-version
option to rustfmt.toml
...
This option specifies the rustfmt version that *must* be used to format the code. Trying to use a
different version raises an error.
closes #1505
2017-10-09 23:07:53 +02:00
topecongiro
d55b3492c0
Rename binop_sep to binop_separator
2017-09-15 15:05:41 +09:00
topecongiro
45e48ec424
Add a new config option to control the placement of a binary operator
2017-09-15 12:10:30 +09:00
Seiichi Uchida
9d49bd22f0
Add explicit lifetime
2017-08-31 13:24:32 +09:00
Seiichi Uchida
4b79055a15
Apply refactoring from cargo clippy
2017-08-31 12:49:12 +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
sinkuu
b433e63d2a
Remove unnecessary blank lines at the start and the end of a block
2017-08-11 17:44:16 +09:00
topecongiro
e69a2aba18
Add error_on_line_overflow_comments config option
2017-08-10 08:13:20 +09:00
topecongiro
7bf9aa25be
Add reorder_extern_crates and reorder_extern_crates_in_group config options
2017-08-09 00:16:18 +09:00
Seiichi Uchida
6ab727e6ff
Set where_density default value to Density::Vertical
2017-08-01 22:27:12 +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
d9dc13efe1
Set reorder_imported_names to true as default
2017-07-13 18:42:49 +09:00
topecongiro
6fd291981e
Sort imports in alphabetical and consistent order
2017-07-13 18:42:14 +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
e3310a6a18
Format source codes
2017-07-11 21:53:10 +09:00
Seiichi Uchida
bc63d69c3f
Format source codes
2017-07-10 02:24:59 +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
Nick Cameron
85ecaf99df
Config knows if an option was default or set
2017-06-16 16:49:54 +12:00
Nick Cameron
1f512948a0
Reformat source code using new defaults
2017-06-13 14:41:49 +12:00
Nick Cameron
32e882789b
Change defaults to RFC style
2017-06-13 14:37:04 +12: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
41b7cc6a73
Set combine_control_expr to false by default and true in rfc-rustfmt
2017-06-05 15:31:44 +09:00
topecongiro
4a0094f28f
Add combine_control_expr option
2017-06-04 19:35:29 +09:00
Nick Cameron
cdc3f9321c
Rename the Style::Default option to Legacy
2017-06-02 11:44:38 +12:00
Ravi Khadiwala
3d0ea5a099
Fix typo in from_toml_path
2017-05-30 22:25:24 -05:00
Ravi Khadiwala
17995e1539
Expose methods to locate and load config
...
* Make method for searching parents for toml file public
* Make method for loading config from path directly public, tweak the
API since it was never returning None
2017-05-30 21:41:30 -05:00
topecongiro
86856491bc
Format source codes
2017-05-25 16:08:08 +09:00
Michael Killough
bce1f309b7
Merge branch 'master' of https://github.com/rust-lang-nursery/rustfmt into config
2017-05-19 16:10:27 +07: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
Michael Killough
3f34ff8229
Return PartialConfig
from Config
methods.
...
Leave serialization to the caller, but provide a
`PartialConfig.to_toml()` method, to deal with the fact that
`file_lines` can't be serialized.
Add a simple test.
2017-05-18 12:10:25 +07:00
Michael Killough
222bac1397
Provide config.set().item(value)
API.
...
This API isn't fantastic, but it's the best I can come up with without
something like `concat_idents!()`. There are relatively few places where
config is set, to hopefully the ugliness isn't disastrous.
Change previous occurences of `config.item = value` to this new API,
rather than using `config.override_value()`. Undo the changes to
`override_value()`, as it's no longer important to propogate the error
to the caller. Add a test for the new interface.
2017-05-18 11:42:32 +07:00
Michael Killough
6098f7f924
Remove ConfigTracker - inline in Config.
...
Use an individual `Cell<bool>` on each config item, rather than
maintaining a set of config names that were accessed. Add a simple unit
test.
2017-05-18 11:07:49 +07:00
Michael Killough
7a4955f705
Add methods to serialize Config to TOML.
...
Two different modes:
- Serialize the full Config object. This is useful as
`Config::default().to_toml()` to output a rustfmt.toml with defaults
(#317 ).
- Serialize only the options that have been accessed. This could be
useful to output a minimal rustfmt.toml for a project. (If the
default value of any unused config item changes, you'll then get the
new default when you come to use it).
This commit doesn't expose this anywhere - deciding a sensible CLI is a
bit trickier.
This commit also has very simple error reporting (Result<String,
String>) - once the CLI is decided, a more sensible method of reporting
errors might become obvious.
2017-05-16 18:08:24 +07:00
Michael Killough
4d879662a9
Track which config items are accessed.
...
Required by #865 . This doesn't introduce any method to view which
parameters are accessed.
We record which config items are accessed even if we don't intend to
output them, as we assume it will be a relatively cheap operation.
2017-05-16 18:05:40 +07:00