topecongiro
7250a468f9
Format source codes
2017-06-05 15:32:21 +09:00
topecongiro
dcc7f32152
Format source codes
2017-06-04 19:37:24 +09:00
topecongiro
a9f529cba4
Format source codes
2017-06-04 19:35:29 +09:00
Seiichi Uchida
4402412b78
Allow attributes in generics of impl
2017-05-27 23:59:29 +09:00
Nick Cameron
393ba27311
Remove dependency on Itertools
2017-05-25 16:23:07 +12:00
topecongiro
ec33121aaf
Format source codes
2017-05-23 22:13:29 +09:00
topecongiro
b4cd9584b3
Implement combining for tuple and block
2017-05-23 12:51:32 +09:00
topecongiro
77a2e9858b
Format source codes
2017-05-23 11:37:33 +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
topecongiro
f5da9d779f
Format source codes
2017-05-03 11:26:25 +09:00
Vincent Esche
42dbe482e3
Made type_punctuation_density
apply too all +
in types
2017-05-02 01:03:46 +02:00
Nick Cameron
c546f1b396
Merge pull request #1454 from topecongiro/match
...
Format nested mathces properly.
2017-05-02 10:40:31 +12:00
topecongiro
a91fd699a0
Add heuristic choosing block or visual indent for unary op based on span
2017-04-15 18:40:39 +09:00
topecongiro
1c1ad525f6
Format source codes
2017-04-15 16:22:54 +09:00
topecongiro
78826e6783
Fix a typo
2017-03-29 09:17:58 +09:00
topecongiro
a2d57e956a
Remove duplicate definitions
...
This commit removes duplicated definitions of `type_annotation_separator` and
`type_bound_colon`.
2017-03-28 23:20:50 +09:00
Nick Cameron
5305bc8436
test fallout
2017-03-28 11:25:59 +13:00
Nick Cameron
5fb1140688
fallout - source reformatting
2017-03-28 11:14:47 +13:00
Nick Cameron
e4efa22983
Source formatting fallout
2017-03-28 10:58:41 +13:00
Nick Cameron
488c0b9546
Test and source fallout
2017-03-22 09:25:26 +13:00
Nick Cameron
e5638e0cb5
More space for qself paths
...
Fixes #1349
2017-03-07 14:53:10 +13:00
Nick Cameron
33b83ae7df
Formatting fallout
...
Also fixes a minor bug when we break a line after `if` and used to leave a trailing space
2017-03-07 09:50:41 +13:00
Nick Cameron
a84f42d13c
Merge pull request #1326 from durka/assoc-type-density
...
honor type_punctuation_density for assoc. types
2017-02-23 15:00:47 +13:00
Nick Cameron
a7612cc773
more fallout
2017-02-23 13:15:48 +13:00
Nick Cameron
9eb78a3333
Fallout
2017-02-23 13:15:48 +13:00
Alex Burka
181cde9afb
honor type_punctuation_density for assoc. types
2017-02-22 15:11:16 -05:00
Nick Cameron
b35906dbce
WIP
2017-02-21 16:35:05 +13:00
Nick Cameron
428339fdc3
Refactor indent and width into Shape struct
2017-01-31 08:35:23 +13:00
Nick Cameron
6572874965
Update to latest Syntex
...
As a side-effect of the Path changes, we are now a bit more aggressive about normalising paths.
2017-01-20 08:20:49 +13:00
Stepan Koltsov
ad46f9af95
Do not ignore space_before_bound in where clause ( #1267 )
2017-01-09 15:58:06 +13:00
Nick Cameron
32cb839855
Macros in types are possible
...
Fixes #1234
2017-01-06 16:06:09 +13:00
Nick Cameron
d3eba76e4d
update Serde, etc.
...
Lots of changes to how closures work
2016-11-21 11:02:18 +13:00
Mikko Rantanen
4b1c669037
Add spaces_within_square_brackets config option. ( #1191 )
...
* Add spaces_within_square_brackets config option.
Enabling the config enforces spaces within various array/slice brackets.
* Fixed budget-calculations for [] spacing
2016-10-18 09:09:49 +13:00
Nick Cameron
23f01eddac
Merge pull request #1188 from Rantanen/master
...
Add support for spaces_within_angle_brackets
2016-10-14 11:38:39 +13:00
Josh Chase
903e30b503
Quick fix for "impl Trait"
...
* Remove "TODO" conversion
* Add a couple of simple test cases
Fix courtesy of @signaraiona
2016-10-13 12:30:16 -07:00
Mikko Rantanen
636a828772
Add support for spaces_within_angle_brackets
...
Enabling the config adds spaces within type arguments: <>
2016-10-13 19:28:18 +03:00
Mikko Rantanen
7be202fa3c
Add support for spaces_within_parens config ( #1187 )
...
* Add support for spaces_within_parens config
* Changes based on review comments
2016-10-13 14:34:08 +13:00
est31
efd3e5c091
Add three new options for spaces
2016-09-17 02:22:13 +02:00
Nick Cameron
4418fab4f2
Update to latest Syntex
...
+ Cargo update
+ 0.6.2 release
2016-09-16 15:28:02 +12:00
sinkuu
a3c63fdef9
Run clippy
2016-08-29 08:57:27 +09:00
Nathan Ridge
4b999a99c0
Add two new whitespace options ( #1109 )
...
* An option to leave a space before the colon in a type annotation
* An option to leave a space before the colon in a trait or lifetime bound
2016-08-03 01:11:39 -04:00
Jacob Clark
77edbb7def
Refactoring exsisting filter_maps to maps
2016-06-07 00:03:25 +01:00
Jacob Clark
2ea99869a7
Refactor string collects to itertools join
2016-06-06 22:30:40 +01:00
Kamal Marhubi
bd10af127e
utils: Move codemap related utilities to a dedicated module
...
This commit adds a `codemap` module, and moves the `CodemapSpanUtils`
added in #857 to it. This is preparation for adding more `Codemap`
specific utilities.
Refs #434
2016-05-31 00:49:26 +02:00
Nick Cameron
5436977bd5
Merge pull request #1017 from marcusklaas/tweak-if-else
...
Format non-statement if-else expressions on a single line
2016-05-31 01:57:29 +12:00
Kamal Marhubi
120e1a0b51
deps: Update syntex_syntax to 0.33
...
This bump brings syntex_syntax support for `..` in tuple and tuple
struct patterns, which come from RFC 1492:
https://github.com/rust-lang/rfcs/blob/master/text/1492-dotdot-in-patterns.md
These new patterns are not properly handled in this PR; instead #1021
tracks supporting them.
Refs #1021
2016-05-30 14:53:04 +02:00
Marcus Klaas
98c0570a28
Format non-statement if-else expressions on a single line
2016-05-29 17:58:38 +02:00