Seiichi Uchida
df7d2be562
Move Indent and Shape to shape.rs from lib.rs
2017-09-19 10:04:35 +09:00
Nick Cameron
d906ea23c7
Merge pull request #1968 from topecongiro/issue-1967
...
Reorder use items inside blocks
2017-09-18 12:59:25 +12:00
Seiichi Uchida
178a339fc3
Reorder use items inside blocks
2017-09-15 22:31:52 +09:00
topecongiro
f51261e93e
Cargo fmt
2017-09-15 12:10:58 +09:00
topecongiro
662ee46e67
Use write_list() to format imports
2017-09-06 18:47:50 +09:00
Seiichi Uchida
4b79055a15
Apply refactoring from cargo clippy
2017-08-31 12:49:12 +09:00
Vadim Petrochenkov
6e5c6f5ba3
Use getters to access Span
fields
2017-08-31 14:14:13 +12:00
topecongiro
e31a48b4d9
Refactoring: remove duplicates
2017-08-30 19:26:45 +09:00
Seiichi Uchida
63ac49638b
Support match_pattern_separator_break_point config option
2017-08-18 23:19:47 +09:00
Nick Cameron
62689ef568
Merge pull request #1861 from topecongiro/refactor-chain
...
Remove unnecessary rewriting
2017-08-10 09:03:45 +12:00
topecongiro
be38606c77
Add leave_last field to ListItems
2017-08-09 16:37:21 +09:00
topecongiro
7bf9aa25be
Add reorder_extern_crates and reorder_extern_crates_in_group config options
2017-08-09 00:16:18 +09:00
Caleb Jones
94df4f8cca
Move the empty path_list handling into rewrite_use_list()
2017-08-06 23:04:33 -04:00
Caleb Jones
fa242a5cd6
Fix #1858 - "Don't erase a use with attributes attached"
...
This prevents code like
#[cfg(unix)]
pub use self::unix::{};
from becoming
#[cfg(unix)]
which would cause the attribute to be attached to the next item.
2017-08-06 19:53:57 -04:00
Seiichi Uchida
e588f2fd7b
Make definitive_tactic more generic via enum Separator
2017-07-31 16:23:42 +09:00
Seiichi Uchida
570a3505b9
Make definitive_tactic more generic with separator length
2017-07-29 22:13:23 +09:00
Nick Cameron
1f991d00e0
Merge pull request #1822 from topecongiro/issue-1172
...
Remove newlines between list elements for expressions
2017-07-27 11:15:53 +12:00
Seiichi Uchida
261865ecc9
Remove newlines between list elements for expressions
2017-07-26 22:43:36 +09:00
topecongiro
38614e7af1
Format source codes and update tests
2017-07-26 17:43:17 +09:00
Seiichi Uchida
9777c0de93
Format source codes and update tests
2017-07-20 00:42:00 +09:00
topecongiro
988e387132
Add imports_indent and imports_layout config options
2017-07-14 09:18:28 +09:00
topecongiro
6fd291981e
Sort imports in alphabetical and consistent order
2017-07-13 18:42:14 +09:00
topecongiro
27b04fec1a
Sort items within import alphabetically in groups
...
We group items in snake_case, CamelCase and SCREAMING_SNAKE_CASE
2017-07-13 18:36:31 +09:00
topecongiro
e3310a6a18
Format source codes
2017-07-11 21:53:10 +09:00
Nick Cameron
c5538d2a58
Merge pull request #1692 from topecongiro/chain/last-item
...
Allow overflowing the last item of chain only if it is multi-lined
2017-06-16 13:24:03 +12:00
topecongiro
208ff15954
Format source codes
2017-06-16 08:49:49 +09:00
topecongiro
0d5768964b
Format source codes and add a test
2017-06-16 07:36:31 +09:00
Nick Cameron
6f30d9e7c9
Reformat tests
2017-06-13 14:42:54 +12:00
Nick Cameron
1f512948a0
Reformat source code using new defaults
2017-06-13 14:41:49 +12:00
est31
727963afe4
Update syntex_syntax
...
Bases on commit to switch to libsyntax by @nrc
2017-06-06 07:31:47 +02: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
Nick Cameron
fba5af2a7d
Merge pull request #1469 from topecongiro/bug/chains
...
Remove a bug when calculating the length of the chain
2017-05-01 15:48:53 +12:00
topecongiro
02cf515be6
Format source codes
2017-04-24 16:50:11 +09:00
topecongiro
0614e94d0d
Format source codes
2017-04-15 18:42:45 +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
Aaron Lobb
0dd0cc1941
Break use
statements into multiple lines ( #1407 )
...
This fixes how line lengths for use statements with multiple
items don't extend beyond the maximum line length.
Fixes #1400
2017-03-26 18:21:43 +13:00
Nick Cameron
488c0b9546
Test and source fallout
2017-03-22 09:25:26 +13:00
Nick Cameron
e7489356c6
Format glob imports
...
Fixes #1356
2017-03-08 10:12:42 +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
a7612cc773
more fallout
2017-02-23 13:15:48 +13:00
Nick Cameron
9eb78a3333
Fallout
2017-02-23 13:15:48 +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
Nick Cameron
21c085261b
Remove self
from use foo::bar::self;
...
Also adds the `normalize_imports` config option.
Fixes #1252
2017-01-06 17:02:56 +13:00
Erick Tryzelaar
e67ffcfb21
Update to the latest syntex module
...
One notable feature is this this adds support for the experimental
`let x = loop { ... break $expr; }` syntax. This also includes a
test for formatting all the break and continue variations.
2016-12-23 11:20:07 -08:00
Fraser Hutchison
f933d31115
Fixes #1184 where reordering import items could cause a panic.
...
Also extends an existing test to avoid regression.
2016-11-03 04:21:47 +00: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