Commit graph

379 commits

Author SHA1 Message Date
Aleksey Kladov
ac4532e161 use format_input function in tests 2016-04-03 00:32:24 +03:00
Aleksey Kladov
255231d9ed don't read config twice during tests 2016-04-02 23:41:25 +03:00
Erik Johnston
8219d15291 Fix incorrect indent with fn_args_layout: Block
The closing parenthesis for the arg list was written on a new line
without first applying the appropriate indent.
2016-04-01 23:01:49 +01:00
Nick Cameron
5b11d2e80f Merge pull request #892 from marcusklaas/closed-ranges
Format closed ranges
2016-03-31 13:47:09 +13:00
Marcus Klaas de Vries
50820c6a43 Merge pull request #883 from marcusklaas/macro-with-name
Properly format macro's with an extra ident
2016-03-30 02:03:28 +02:00
Marcus Klaas
9eee93306a Format closed ranges 2016-03-29 23:58:45 +02:00
Marcus Klaas
9e5c0390a0 Properly format macro's with an extra ident 2016-03-29 23:16:40 +02:00
Nick Cameron
cfc9f70116 Merge pull request #885 from marcusklaas/empty-trait-type-params
Remove trailing whitespace for fn types /w non-unit return
2016-03-29 08:17:52 +13:00
Nick Cameron
7d66861b82 Merge pull request #882 from marcusklaas/empty-makro-issues
Fix issues with empty macros with curly braces
2016-03-29 08:14:27 +13:00
Marcus Klaas
0142191e51 Remove trailing whitespace for fn types /w non-unit return 2016-03-27 20:40:23 +02:00
Marcus Klaas
0e0cf976c9 Fix issues with empty macros with curly braces 2016-03-27 13:44:40 +02:00
Marcus Klaas
03bf1ceeb9 Fix tuple destructuring in impl fns 2016-03-27 13:07:28 +02:00
Marcus Klaas de Vries
8fd95df54a Merge pull request #868 from rust-lang-nursery/tuple-wide
Don't apply the function args heuristic to tuple lits.
2016-03-24 14:57:24 +01:00
Marcus Klaas de Vries
ca757183fe Merge pull request #864 from Venti-/fn-density
Add option for vertical function argument list
2016-03-22 10:14:04 +01:00
Marcus Klaas de Vries
6f2bb908bb Merge pull request #866 from rust-lang-nursery/empty-extern
Keep empty extern blocks on one line
2016-03-16 18:06:25 +01:00
Connor Brewster
0a665aaceb Fixed nitpicks
Removed unneeded comment
Commented line wrapping conditions
Removed prefix param on `rewrite_associated_type`
Merged `rewrite_associated_static` into `rewrite_static`
Added extra tests
2016-03-15 14:08:12 -06:00
Connor Brewster
54a9f0ebd0 Readded spaces to source test 2016-03-14 20:11:39 -06:00
Connor Brewster
2793b4090c Added tests 2016-03-14 20:05:20 -06:00
Nick Cameron
9d8ce54428 Don't apply the function args heuristic to tuple lits.
Closes #450
Closes #510
2016-03-14 20:51:06 +13:00
Nick Cameron
96a2f25788 Keep empty extern blocks on one line
Closes #462
2016-03-14 18:55:55 +13:00
Ari Koivula
8d299210a6 Add independent test for Vertical rustfmt-fn_args_density 2016-03-14 04:03:33 +02:00
Ari Koivula
f4171e97eb Add test for vertical fn_args_density 2016-03-14 02:02:37 +02:00
Connor Brewster
3163071c75 Updated to latest rustfmt 2016-03-12 11:09:27 -07:00
Connor Brewster
35dfcc0078 Adding trait formatting
trait header formatting finished
generic formatting finished
added basic trait bounds formatting
2016-03-11 14:18:30 -07:00
Amanieu d'Antras
ef03dcaa7f Add a test for #850 2016-03-09 02:44:01 -08:00
Vincent Esche
a0567d4063 Fix for issue #811 (falsely inserted "::" in paths with parameterized trait cast). 2016-03-01 16:39:43 +01:00
Nick Cameron
d86cfb357a Format all patterns (well, except macros)
Fixes #18
Fixes #672
2016-02-12 14:59:13 +13:00
Kamal Marhubi
14dbac5fd7 config: Use write_mode from config
This commit tidies up handling of `write_mode` by setting it in the
config at the start, and removing the `write_mode` parameter threaded
throughout the formatting process.
2016-02-08 22:52:44 -05:00
Nick Cameron
a6d70547e0 Merge pull request #799 from kamalmarhubi/const-instead-of-static
cleanup: Use const instead of static
2016-02-03 19:26:38 +13:00
Marcus Klaas de Vries
9c969ca6fb Merge pull request #786 from rust-lang-nursery/str-leave
Don't reformat strings if we don't have to.
2016-02-03 06:11:01 +01:00
Kamal Marhubi
8b601812a6 cleanup: Use const instead of static 2016-02-01 23:40:45 -05:00
Kamal Marhubi
2b991bc260 tests: Use Result::expect() throughout
`Result::expect()` was added in Rust 1.4. Using it tidies up the code,
and also helps by printing error details, eg, printing syntax error
details if a regex fails to compile. It adds a colon followed by the
`Debug` output from any error, making the periods in messages
unnecessary.
2016-01-31 13:10:09 -05:00
Nick Cameron
a0e85f9a5f Put empty modules on one line
Fixes #463
2016-01-28 19:53:41 +13:00
Nick Cameron
02302d2800 Don't reformat strings if we don't have to.
Specifically if no line exceeds the allowed width and we aren't moving the string to a new offset
2016-01-28 19:14:08 +13:00
DarkDrek
feb09a42f5 Fix #784 2016-01-27 02:18:05 +01:00
Nick Cameron
4344c51c80 Merge pull request #783 from jwazny/issue-588
Added where_trailing_comma option.
2016-01-26 22:23:05 +13:00
Jeremy Wazny
d23628c91b Added tests. 2016-01-26 16:55:51 +11:00
Jeremy Wazny
d82d3b2cd1 Added where_trailing_comma option.
The default is 'false', since a lot of the time there's only a single
predicate.
2016-01-26 12:42:11 +11:00
Kevin Yeh
7fc70a1753 Add item macro tests 2016-01-24 13:11:18 -06:00
Kevin Yeh
f01ed6f507 Format item macros 2016-01-22 13:43:18 -06:00
Nick Cameron
81516fe8ca Merge pull request #745 from markstory/checkstyle-output
RFC implementation of checkstyle output
2016-01-22 17:48:39 +13:00
Mark Story
e9e5621307 Extract helper functions for testing.
These functions help reduce duplication in the test harness and make it
easier to add tests for other write-modes in the future.
2016-01-21 22:28:17 -05:00
Mark Story
9c275833fc Get checkstyle tests passing.
Fix up the checkstyle test so they pass. There is still an issue with
the content, but I think that is caused by a problem with how diffs are
being calculated presently.
2016-01-20 00:07:01 -05:00
Mark Story
66d4faf53f Start tests for checkstyle.
They don't yet pass, I've clearly misunderstood the existing tests.
2016-01-18 22:44:10 -05:00
Nick Cameron
f0ca7aec24 Fix an off-by-one error due to the comma in a struct lit field
Also allows splitting the field expression on a new line after the field name.

Fixes #698
2016-01-14 20:26:15 +13:00
Victor M. Suarez
4f8938c616 Allow for setting of write-mode via config file. FIxes #215
Also from @marcusklaas:
 Refactor code output functions

 Specifically, `write_all_files` no longer returns a HashMap. It would sometimes
 contain items, and sometimes be empty. When "fixed" newlines are required, this
 must now be done with a separate call. The tests use this strategy and should now pass!
2016-01-12 18:12:48 -05:00
Marcus Klaas de Vries
ba465e0fc2 Merge pull request #766 from ConnorGBrewster/fix-#489
Added option for tighter punctuation in types. fixes #489
2016-01-12 22:52:34 +01:00
Marcus Klaas de Vries
4cefecb495 Merge pull request #768 from DarkDrek/amend-to-fix-#447
fixes parsing issue #767
2016-01-12 21:53:19 +01:00
Connor Brewster
7f8b9bd356 Added test case 2016-01-12 13:51:32 -07:00
Marcus Klaas de Vries
b99e8eda29 Merge pull request #757 from ConnorGBrewster/fix-#650
Fix for #650
2016-01-12 21:17:45 +01:00