Commit graph

995 commits

Author SHA1 Message Date
Aleksey Kladov
294b463b5d minor: use &mut ref instead of by value argument
This also unifies `write_all_files` and `write_file` functions
2016-04-02 19:36:56 +03:00
Erik Johnston
57847e451a Add fn_arg_one_line option
If set, arguments will be kept on one line if they fit. Currently only
applies when `fn_args_layout` is set to `Block`.

This commit also fixes a bug where newlines were inserted inbetween
argument brackets when there were no arguments and `fn_args_layout` was
set to `Block`.
2016-04-02 00:25:35 +01:00
Nick Cameron
c3cef52cde Merge pull request #895 from erikjohnston/fn_arg_block_incorrect_indent
Fix incorrect indent with fn_args_layout: Block
2016-04-02 11:10:06 +13: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
Nick Cameron
19768da5c9 Version bump - v0.4
closes #870
2016-03-30 15:19:46 +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
f941646118 Do not panic on type ascription or try shorthand
Instead, simply format expressions involving these unstable features
as they were found.
2016-03-30 00:01:54 +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
d3b18d0b45 Merge pull request #889 from kamalmarhubi/next-power-of-two
Use checked_next_power_of_two from std instead of custom method
2016-03-29 21:00:31 +13:00
Nick Cameron
11391dfe7b Merge pull request #891 from kamalmarhubi/update-syntex-syntax
deps: Update syntex_syntax to 0.30.0
2016-03-29 20:58:57 +13:00
Nick Cameron
dd96c55801 Merge pull request #886 from matklad/make-illegal-states-unrepresentable
Introduce verbosity enum
2016-03-29 20:57:16 +13:00
Kamal Marhubi
f2b5931c6d deps: Update syntex_syntax to 0.30.0
This bump includes ability to parse inclusive ranges (`a...b`) and the
question mark operator.

Refs #867, #890
2016-03-29 00:04:44 -04:00
Kamal Marhubi
8168c7c44c Use checked_next_power_of_two from std instead of custom method
NB The custom method returned 0 on an input of 0, which is arguably
incorrect: 0 is not a power of two; the method in `std` returns 1 in
that case.
2016-03-28 23:36:22 -04:00
Nick Cameron
6526533745 Merge pull request #879 from matklad/proper-exit-code
cargo-fmt: don't return zero on failure
2016-03-29 13:56:00 +13:00
Aleksey Kladov
c7e51d3994 minor: use enum instead of pair of booleans
This is a bit more typing, but statically forbids using both verbose and
quiet
2016-03-29 02:37:43 +03:00
Aleksey Kladov
ac7778cc51 cargo-fmt: don't return zero on failure 2016-03-29 02:11:43 +03: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
Nick Cameron
9e399463e7 Merge pull request #881 from marcusklaas/nightly-update
Fix tuple destructuring in impl fns
2016-03-29 08:03:57 +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
4cb043112b Merge pull request #874 from kamalmarhubi/rustfmt_skip-clarification
readme: Clarify the ways of specifying rustfmt_skip
2016-03-17 09:32:25 +01:00
Kamal Marhubi
0e0f3c8c61 readme: Clarify the ways of specifying rustfmt_skip
It was previously unclear that the `cfg_attr` version works in stable
Rust.
2016-03-17 00:51:16 -04: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
Nick Cameron
73f5f4a213 Merge pull request #869 from ConnorGBrewster/add-trait-formatting
Add trait formatting
2016-03-16 11:24:26 +13: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
a0a5335634 Fixed span_after issue 2016-03-14 20:51:41 -06:00
Connor Brewster
7a6eb2197e Merge branch 'master' of https://github.com/rust-lang-nursery/rustfmt into add-trait-formatting 2016-03-14 20:49:14 -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
Connor Brewster
7ba43ff06e Finished implementing impl and trait type/const 2016-03-14 19:52:07 -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
Nick Cameron
204e732c1b cargo update 2016-03-14 18:19:57 +13:00
Nick Cameron
da65090050 Merge pull request #857 from kamalmarhubi/codemap-ext
utils: Add CodeMapExt extension trait for span_* methods
2016-03-14 18:00:51 +13:00
Ari Koivula
8d299210a6 Add independent test for Vertical rustfmt-fn_args_density 2016-03-14 04:03:33 +02:00
Ari Koivula
0c8640a84f Fix last comment turning into block comment
This fixes the comment after the last argument in an argument list
being turned into a block comment when it's not necessary.
2016-03-14 02:02:52 +02:00
Ari Koivula
f4171e97eb Add test for vertical fn_args_density 2016-03-14 02:02:37 +02:00
Ari Koivula
db9d129025 Add Vertical fn_args_density
This adds new option Vertical to fn_args_density, which formats the
list vertically no matter what.
2016-03-14 02:00:21 +02:00
Kamal Marhubi
d82d9fc808 utils: Add CodeMapSpanUtils trait for span_* methods
This commit adds a CodeMapSpanUtils extension trait on CodeMap, and
moves some functions to methods there:
  - span_after
  - span_after_last
  - span_before

This better reflects them being lookup methods on the codemap.
2016-03-13 18:14:07 -04:00
Nick Cameron
17856e8d56 Merge pull request #859 from solidsnack/master
Write non-output to stderr when there is output
2016-03-14 11:13:46 +13:00
Connor Brewster
3163071c75 Updated to latest rustfmt 2016-03-12 11:09:27 -07:00
Connor Brewster
87a5d88aeb Uncommented missed spans check 2016-03-12 10:53:47 -07:00
Connor Brewster
de95b4cefb Removed unneeded pattern matching 2016-03-11 22:50:30 -07:00
Connor Brewster
34651c4f78 Fixed formatting 2016-03-11 22:41:22 -07:00