Nick Cameron
aed558fce4
Handle multi-line return types and multi-line tuples
...
Closes #409
2015-10-10 14:55:31 +13:00
Sinh Pham
f075fd01ab
Fix https://github.com/nrc/rustfmt/issues/430
2015-10-08 22:49:16 -07:00
mwiczer
5162282b60
Support pre- and post-comments for enums
...
Use lists to format enum variants rather than special formatting.
Add tests for enums mostly around block comments.
2015-10-08 17:22:57 -04:00
Marcus Klaas de Vries
5eeae3944e
Merge pull request #404 from marcusklaas/rewrite-list-fmt
...
List formatting refactoring
2015-10-06 22:29:52 +02:00
Marcus Klaas
199d40fa55
Increase default function call width limit
2015-10-06 22:27:11 +02:00
Marcus Klaas
a76df6b4d9
Make listItem contain option
2015-10-04 20:40:14 +02:00
Marcus Klaas
965ea09664
Split ListTactic decision logic from write_list
2015-10-04 20:40:14 +02:00
Marcus Klaas
84718b5b90
Format rustfmt's own indices
2015-10-02 11:48:52 +02:00
Nick Cameron
617eed353c
Changes to rustfmt source
2015-09-26 18:29:48 +12:00
Nick Cameron
b894dd8abf
Use a width heuristic for struct lits.
...
Closes #123
2015-09-26 18:25:41 +12:00
Nick Cameron
d161b8df72
rebasing changes and address review comment
2015-09-26 14:00:19 +12:00
Nick Cameron
ebf64ca35d
Heuristic max width for function calls
2015-09-26 13:54:22 +12:00
Nick Cameron
dcbfd0469f
Merge pull request #362 from marcusklaas/rewrite-string
...
Make rewrite_string return `Option<String>`
2015-09-26 13:36:59 +12:00
Marcus Klaas
5db17ca703
Use the maximum available width in struct formatting
...
Previously, we'd use an approximation for the maximum width since the configuration wasn't available in `write_list`.
2015-09-25 16:56:22 +02:00
Marcus Klaas
a7690cb1e5
Make rewrite_string return Option<String>
2015-09-25 13:01:20 +02:00
Eli Friedman
19e887c309
Add support for formatting AddrOf (unary "&").
2015-09-24 01:13:57 -07:00
Pavel Sountsov
03e1b27826
Add Indent::none(), remove make_indent.
2015-09-19 10:36:45 -07:00
Pavel Sountsov
d4108a3029
Initial implementation of hard tab indentation.
2015-09-19 10:36:45 -07:00
Marcus Klaas
f751356910
Format macro invocations
2015-09-16 20:26:14 +02:00
Marcus Klaas
03c660633f
Refine chain breaking heuristics
...
Don't make a single line chain when it is was multi line in the source; allow overflow of the last chain element onto the next lines without breaking the chain.
2015-09-11 00:53:01 +02:00
Marcus Klaas
48d17f54d3
Rebase onto master
2015-09-11 00:53:01 +02:00
Marcus Klaas
749a9689be
Break chains that don't start with path expressions
2015-09-11 00:52:57 +02:00
Marcus Klaas
659c9b9037
Update indentation heuristics for single arg functions
2015-09-11 00:52:20 +02:00
Marcus Klaas
c680bb4030
Implement basic chain formatting
2015-09-11 00:52:16 +02:00
Marcus Klaas
f80dcbbd84
Split off binary search
2015-09-07 22:21:56 +02:00
Marcus Klaas
d05a41c773
Add failure mode to write_list
2015-09-07 20:35:25 +02:00
Andre Bogus
d6c652e33c
code improvements suggested by clippy
2015-09-04 23:39:33 +02:00
Nick Cameron
97e92b35cc
Preserve some whitespace between struct fields etc.
2015-09-02 14:11:19 +12:00
Nick Cameron
02a01350ff
Support where predicates on the same line
2015-09-01 18:53:16 +12:00
Marcus Klaas
120fd2426e
Format assignment
2015-08-25 21:43:13 +02:00
Ivan Apachev
c7e6d0b54a
Replace uses of x.len() == 0 by x.is_empty() #187
2015-08-25 01:07:48 +03:00
Marcus Klaas
5fcd313b08
Format closures
2015-08-19 23:15:56 +02:00
Nick Cameron
a43e2b5ae8
Formatting
2015-08-20 08:11:14 +12:00
Marcus Klaas
4e0a8da447
Refactor itemize list so that it produces an iterator
2015-08-19 18:40:02 +02:00
Marcus Klaas
41bca58100
Format paths
2015-08-16 22:53:06 +02:00
Marcus Klaas
2fa6220f57
Format all the loops!
2015-07-19 23:43:32 +02:00
Gaëtan Cassiers
990a123e1c
Run rustfmt on the code
2015-07-03 11:13:28 +02:00
Marcus Klaas
482f200b0b
Update import list formatting
...
Include comments and sort items alphabetically.
2015-06-26 03:43:12 +02:00
Marcus Klaas
28f7bd4205
Fixup comment wrapping in lists
2015-06-24 21:14:08 +02:00
Marcus Klaas
9f3ab0b5fe
Format comments in struct literals
2015-06-24 01:11:29 +02:00
Marcus Klaas
0ef5db9496
Format tuple-like structs
2015-06-23 16:54:42 +02:00
Marcus Klaas
d335d04575
Implement checks for unnumbered TODOs and FIXMEs
2015-06-12 20:58:23 +02:00
Gaëtan Cassiers
adedba45a8
Use impl_enum_decodable for SeparatorTactic
2015-06-08 19:40:22 +02:00
Marcus Klaas
1ef7e23dd1
Move vertical mode override to write_list
2015-06-04 13:47:35 +02:00
Nick Cameron
46818d405a
Struct literals
2015-05-25 19:14:20 +12:00
Marcus Klaas
c790d7d550
Keep import lists on a single line when possible
2015-05-04 22:22:31 +02:00
Nick Cameron
81b8eb7993
Comments on their own lines between args
2015-04-28 21:57:16 +12:00
Nick Cameron
daff43f761
Arg/line length bug
2015-04-23 18:35:56 +12:00
Nick Cameron
28d90bc439
trailing newline hell fixed
2015-04-23 18:02:55 +12:00
Nick Cameron
0c5f5082dc
terminating newline bug
2015-04-23 17:04:07 +12:00