Commit Graph

1005 Commits

Author SHA1 Message Date
Aleksey Kladov
07cf62fc42 simplify tests
* change layout so that test group `foo` has source files in
`test/foo/source` and target files in `test/foo/target`.

* use significant comments to specify write mode instead of threading
  Option<WriteMode>
2016-04-05 02:45:39 +03:00
Nick Cameron
4fdf859787 Merge pull request #897 from matklad/refactor-run
Refactor run family of functions
2016-04-05 11:25:13 +12:00
Aleksey Kladov
c29ee66b94 make naming more consistent 2016-04-05 01:20:14 +03:00
0x0G
6e393b3d53 Fix. rustfmt write to stderr instead stdout
Fix. rustfmt write to stderr instead stdout
2016-04-04 12:49:16 +02:00
Nick Cameron
d9ccec6f82 Merge pull request #898 from srinivasreddy/spell
Correct spelling of 'style'
2016-04-03 22:43:20 +12:00
Aleksey Kladov
63887ed413 make format_string and fmt_lines private 2016-04-03 00:45:04 +03:00
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
Srinivas Reddy Thatiparthy
bee9682a49 Correct spelling of 'style' 2016-04-03 01:08:25 +05:30
Aleksey Kladov
84fb2f402e refactor: unify run and run_from_stdin 2016-04-02 22:24:38 +03:00
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