topecongiro
4a0094f28f
Add combine_control_expr option
2017-06-04 19:35:29 +09:00
topecongiro
b548d8d773
Refactor rewrite_call
2017-06-04 19:35:29 +09:00
topecongiro
a01ad30459
Forbid line break between if and pattern
2017-06-04 19:35:29 +09:00
topecongiro
aadd3e11f4
Unindent comment on top of else
2017-06-02 11:58:58 +09:00
Seiichi Uchida
5650411d64
Fix a typo
2017-06-02 11:20:49 +09:00
Nick Cameron
cdc3f9321c
Rename the Style::Default option to Legacy
2017-06-02 11:44:38 +12:00
Nick Cameron
0480f7e105
Merge pull request #1620 from topecongiro/rfc-if
...
Use correct line budget when using Rfc control style
2017-06-02 11:36:16 +12:00
topecongiro
fbd4b87329
Use correct one line budget when using Rfc control style
2017-06-01 19:59:50 +09:00
Seiichi Uchida
10c3632078
Format source codes
2017-06-01 12:08:25 +09:00
Seiichi Uchida
789abf063d
Use block indent style when visual indent failed
2017-06-01 12:08:20 +09:00
Nick Cameron
9b79cb5c22
Merge pull request #1602 from topecongiro/attributes-on-expressions
...
Allow attributes on expressions
2017-05-28 18:34:50 +12:00
topecongiro
99c2eab5ac
Allow attributes on expressions
2017-05-28 11:44:41 +09:00
Seiichi Uchida
a22228acee
Avoid unnecessary binary search in rewrite_call
2017-05-27 21:56:23 +09:00
topecongiro
554605d47c
Format source codes and add tests
2017-05-26 16:40:19 +09:00
topecongiro
15b988aed3
Allow macro to nested and overflowed like function call
2017-05-26 16:35:34 +09:00
topecongiro
b748fe8bec
Set inside_macro to false when rewriting args of macro
2017-05-26 16:34:58 +09:00
Nick Cameron
3d135ebba4
Merge pull request #1586 from topecongiro/minor
...
Fix minor bugs
2017-05-26 08:43:52 +12:00
Seiichi Uchida
92270ba191
Add offset when rewriting index
2017-05-25 23:01:41 +09:00
topecongiro
86856491bc
Format source codes
2017-05-25 16:08:08 +09:00
topecongiro
4d6e385f09
Refactoring: introduce one_line_budget
2017-05-25 15:50:46 +09:00
topecongiro
c8ad521c9f
Decide whether args fit in a single line inside rewrite_call_args
2017-05-25 06:10:00 +09:00
topecongiro
04bb5d8929
Format source codes
2017-05-24 00:07:02 +09:00
topecongiro
ec33121aaf
Format source codes
2017-05-23 22:13:29 +09:00
topecongiro
f83c22f24f
Add trailing comma to a single arg in multiline
2017-05-23 13:26:59 +09:00
topecongiro
b4cd9584b3
Implement combining for tuple and block
2017-05-23 12:51:32 +09:00
topecongiro
2c15204f0c
Update tests
2017-05-23 12:51:13 +09:00
topecongiro
29c0ab77ba
Implement combining openings and closings
2017-05-23 12:45:09 +09:00
topecongiro
dc8d3aa23a
Update tests
2017-05-23 11:39:31 +09:00
topecongiro
77a2e9858b
Format source codes
2017-05-23 11:37:33 +09:00
topecongiro
f2ec5a7bac
Refactor source codes
2017-05-23 11:37:12 +09:00
topecongiro
520340481d
Allow macro rewrite to fail on rhs
2017-05-23 11:37:12 +09:00
Michael Killough
c3c2e823cb
Merge branch 'master' of https://github.com/rust-lang-nursery/rustfmt into config
2017-05-18 13:05:19 +07:00
topecongiro
d7b6f1199f
Format source codes
2017-05-16 23:24:38 +09:00
Michael Killough
c0bdbfa531
Switch to accessing config items via method.
...
Preparation for #865 , which proposes adding a flag which outputs which
config options are used during formatting.
This PR should not make any difference to functionality. A lot of this
was search-and-replace.
Some areas worthy of review/discussion:
- The method for each config item returns a clone of the underlying
value. We can't simply return an immutable reference, as lots of
places in the code expect to be able to pass the returned value as
`bool` (not `&bool). It would be nice if the `bool` items could
return a copy, but the more complex types a borrowed reference... but
unfortunately, I couldn't get the macro to do this.
- A few places (mostly tests and `src/bin/rustfmt.rs`) were overriding
config items by modifying the fields of the `Config` struct directly.
They now use the existing `override_value()` method, which has been
modified to return a `Result` for use by `src/bin/rustfmt.rs`. This
benefits of this are that the complex `file_lines` and `write_mode`
strings are now parsed in one place (`Config.override_value`) instead
of multiple. The disadvantages are that it moves the compile-time
checks for config names to become run-time checks.
2017-05-16 15:47:09 +07:00
Seiichi Uchida
762db5138e
Format source codes
2017-05-15 22:55:45 +09:00
Seiichi Uchida
79ba34c607
Use offset_left for rewrite_unary_prefix
2017-05-15 22:55:01 +09:00
Nick Cameron
ebb26db68b
Merge pull request #1551 from topecongiro/else-if-early-line-break
...
Forbid early line breaks inside else if
2017-05-15 08:59:03 +12:00
Seiichi Uchida
819a13030f
Use precise width when rewriting else if
2017-05-13 21:07:36 +09:00
Seiichi Uchida
7ec78711f2
Prevent rewriting closure block to expr inside macro
2017-05-13 18:32:25 +09:00
Seiichi Uchida
56515dd4d6
Merge pull request #1543 from topecongiro/field-attr
...
Support struct_field_attributes
2017-05-12 20:08:36 +09:00
topecongiro
744fa427e2
Support struct_field_attributes
2017-05-12 17:58:38 +09:00
topecongiro
384ce46eef
Use vertical layout when args len is larger than fn_call_width
2017-05-12 16:30:26 +09:00
topecongiro
ba1a7b9e7f
Try multi-line only when fn_call_style is Block and rewriting function call
2017-05-12 10:33:05 +09:00
Nick Cameron
1eec103516
Merge pull request #1523 from topecongiro/poor-formatting/fn_call_style
...
Use multiline when args exceeds max_width in fn_call_style = "block"
2017-05-10 08:27:24 +12:00
topecongiro
30a8050559
Use multiline when args exceeds max_width in fn_call_style = "block"
2017-05-10 00:27:57 +09:00
topecongiro
9d96c33d59
Inherit alignment to last else
2017-05-09 17:33:45 +09:00
topecongiro
ac6e6dfd5d
Refactor rewrite_pat_expr
2017-05-09 17:33:28 +09:00
Nick Cameron
35e1ca73fc
Merge pull request #1519 from topecongiro/poor-formatting/if-else
...
Remove visual_indent when rewriting else block
2017-05-09 15:21:29 +12:00
topecongiro
0248e9869d
Apply closure exception to match in args
2017-05-09 08:28:05 +09:00
topecongiro
f36411c339
Remove visual_indent when rewriting else block
2017-05-09 08:11:05 +09:00