Commit graph

38 commits

Author SHA1 Message Date
Kevin Yeh
314aff1a33 Reformat trim_newlines 2015-11-25 22:46:11 -06:00
Kevin Yeh
f5fac4c54f Fix empty trim_newline panic, add impl macro test 2015-11-24 14:37:31 -06:00
Nick Cameron
9cf8529e33 Implement formatting for impls
Fixes #614
2015-11-23 13:09:00 +13:00
Marcus Klaas
840012b5e0 Format bare function types
Fix https://github.com/rust-lang-nursery/rustfmt/issues/616.
Fix https://github.com/rust-lang-nursery/rustfmt/issues/276.
Close https://github.com/rust-lang-nursery/rustfmt/issues/350.
2015-11-22 16:07:38 +01:00
Marcus Klaas
6e1f77664d Unwrap match arms that are simple blocks 2015-11-20 21:05:18 +01:00
Kevin Yeh
4d7de5a16e Support single-line functions
By default, places functions with empty bodies on one line.
If the function has only one expression or statement that fits on one line, the 'fn_single_line' option can be used.
2015-11-19 14:23:56 -06:00
Alex Crichton
e6b7ad3e39 Ignore #[cfg_attr(rustfmt, rustfmt_skip)] functions
This adds to #[rustfmt_skip] but is usable on stable Rust!
2015-10-23 13:46:14 -07:00
Marcus Klaas
01937061a9 Format more type variants 2015-10-17 16:05:59 +02:00
Scyptnex
00b314618d Refactoring configuration 2015-09-29 09:38:19 +10: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
Aaron Lobb
d773580715 Changed ConfigType trait to only return a string of variants, rather than a vec 2015-09-14 13:43:55 -07:00
Aaron Lobb
8b808de6ff Fixed https://github.com/nrc/rustfmt/issues/291; added output to --help runtime option with possible config values 2015-09-14 00:29:15 -07:00
Marcus Klaas
7f576b0602 General cleanup after rebase 2015-09-11 00:53:21 +02:00
Marcus Klaas
a9814149c9 Align dots in chained expressions 2015-09-11 00:53:01 +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
Sinh Pham
61f642f6f8 Support unicode in string literals. 2015-09-03 23:41:25 -04:00
Nick Cameron
ae1eec81af Rewrite match expressions (continued). 2015-08-20 08:11:14 +12:00
Nick Cameron
a43e2b5ae8 Formatting 2015-08-20 08:11:14 +12:00
Nick Cameron
dc2544712c Rewrite match expressions 2015-08-20 08:08:11 +12:00
Marcus Klaas
8e22a73cb7 Add option to override single configuration lines for tests 2015-08-19 21:51:03 +02:00
Marcus Klaas
41bca58100 Format paths 2015-08-16 22:53:06 +02:00
Marcus Klaas
82b27fc4ab Correctly format typed self in function arguments 2015-08-14 11:56:27 +02:00
Marcus Klaas
b161815fe0 Format if-else expressions 2015-07-19 23:42:54 +02:00
Gaëtan Cassiers
fc4483748c Fix fn decl rewriting in case of generics
An opening paren in generics caused a false-positive detection of args
beginning. The result was the creation of comments with some code into
it.
2015-07-03 10:30:42 +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
Gaëtan Cassiers
2161400c7d Add a try_opt! macro for ease of work with Rewrite 2015-06-23 02:15:46 +02:00
Gaëtan Cassiers
35c996054a Use wrapping operations for bit-level functions
This handles a underflow panic on round_up_to_power_of_two(0).
2015-06-22 17:42:05 +02:00
Marcus Klaas
b17c920e46 Deal with problematic characters in comments 2015-06-15 15:07:47 +02:00
Marcus Klaas
d335d04575 Implement checks for unnumbered TODOs and FIXMEs 2015-06-12 20:58:23 +02:00
Gaëtan Cassiers
4d6d0b81a7 Fix mod ordering + formatting 2015-06-08 20:23:24 +02:00
Gaëtan Cassiers
adedba45a8 Use impl_enum_decodable for SeparatorTactic 2015-06-08 19:40:22 +02:00
Marcus Klaas
90bc40a111 Implement basic enum formatting 2015-06-02 15:52:07 +02:00
Nick Cameron
4c869a1b9d Extract out more files 2015-04-21 21:01:19 +12:00