Nick Cameron
95ff52f06f
Tabbed/Inherit indent for chains works even without a newline after first item.
2016-04-22 18:41:38 +12:00
Nick Cameron
3d46532e72
refactor and document the chain reformatting code
2016-04-22 14:47:00 +12:00
Nick Cameron
4c3228530f
block indent large closures
...
somewhat rough around the edges
2016-04-22 11:29:01 +12:00
mrBliss
b0755581ca
Format visibility of associated consts ( #953 )
...
Fixes #951 .
2016-04-19 20:19:14 +02:00
Nick Cameron
75aeca4d39
Merge pull request #950 from marcusklaas/extern-abi
...
Add option to force explicit extern ABI's
2016-04-19 07:44:25 +12:00
Marcus Klaas
f364a7ec43
Add option to force explicit extern ABI's
2016-04-18 18:39:40 +02:00
Marcus Klaas de Vries
68f04cec37
Merge pull request #948 from flutterhash/master
...
Added option to configure if/else brace style
2016-04-17 23:15:37 +02:00
Thia Wyrod
d773cc5327
Added loop/match brace style control option
...
This adds Allman style loop/match braces as an alternative to the current
default style.
2016-04-17 14:52:04 -06:00
Thia Wyrod
5bd6036218
Added option to configure if/else brace style
2016-04-17 14:48:51 -06:00
Nick Cameron
fe993dbdf3
Merge pull request #947 from marcusklaas/match-pattern-limit
...
Fix off-by-one error in pattern formatting
2016-04-17 10:23:48 +12:00
Marcus Klaas
63f0fc9641
Fix off-by-one error in pattern formatting
2016-04-16 22:42:52 +02:00
Kamal Marhubi
27c91ee35b
rustfmt: Parse options once instead of once per file argument ( #944 )
...
`update_config()` was parsing the `write-mode` option once for each file
argument. This commit parses them once up front into a `CliOptions`
struct, which is then applied to the config before calling `run()`.
2016-04-16 22:34:15 +02:00
Nick Cameron
41e037da7e
Merge pull request #941 from marcusklaas/type-ascription
...
Format type ascription
2016-04-16 16:42:56 +12:00
Nick Cameron
f70d306b83
Merge pull request #942 from marcusklaas/break-continue-fix
...
Check length of break and continue expressions
2016-04-16 16:42:17 +12:00
Nick Cameron
ebebe96aab
Merge pull request #938 from kamalmarhubi/rename-doc-hint
...
config: Rename get_variant_names to doc_hint
2016-04-16 16:41:21 +12:00
Marcus Klaas
d98e22c971
Check length of break and continue expressions
2016-04-15 18:11:29 +02:00
Marcus Klaas
45a83d18cc
Format type ascription
2016-04-15 17:56:43 +02:00
Aleksey Kladov
847bad603e
Don't print empty lines to stderr ( #940 )
2016-04-15 16:52:21 +02:00
Nick Cameron
7a758ea20a
Fix closures again ( #937 )
...
* Fix closures again
Closes #934
Oh god, the rules for parsing closures are even more messed up than I thought - whether or not there is an inner block or depends not only on if there are braces, but also if there is a return type for the closure (!) and if there are statements in the block.
* Fix overflow
2016-04-15 10:52:08 +02:00
Kamal Marhubi
a2426a678d
config: Rename get_variant_names to doc_hint
...
The `ConfigType` trait is implemented for non-enum types, so the name no
longer makes perfect sense.
2016-04-15 01:11:04 -04:00
Nick Cameron
e1d33df302
Merge pull request #923 from matklad/proper-exit-code
...
return non-zero exit code if there are errors
2016-04-15 13:50:10 +12:00
Aleksey Kladov
77350e49b5
return non-zero exit code if there were errors
2016-04-15 02:51:50 +03:00
Nick Cameron
5adc453f23
Merge pull request #936 from marcusklaas/licenses
...
Add license stuff
2016-04-15 08:13:55 +12:00
Nick Cameron
7bda8659ec
Merge pull request #935 from marcusklaas/issue-770
...
Add regression test for issue 770
2016-04-15 08:13:26 +12:00
Marcus Klaas
6e158e4690
Add license stuff
2016-04-14 20:48:21 +02:00
Marcus Klaas de Vries
320df84e96
Fix brace indentation for impl items ( #927 )
2016-04-14 20:42:38 +02:00
Marcus Klaas
ba9d64aba5
Add regression test for issue 770
2016-04-14 20:41:23 +02:00
Nick Cameron
3cc24c6a1a
Merge pull request #928 from matklad/patch-1
...
don't silence error unnecessary
2016-04-14 11:42:25 +12:00
Aleksey Kladov
b1efb3a39e
don't silence error unnecessary
...
This `if` was used to separate error output from the formatting output, when they both used stdout. It was useful for integration with tools, which can submit input to stdin and read pretty printed result from stdout without worrying about errors intermingled with the actual result.
But now we write errors to `stderr`, so the problem disappears and we can safely remove this `if`.
Errors should never pass silently, unless explicitly silenced.
2016-04-14 01:39:39 +03:00
Nick Cameron
14775eb046
Merge pull request #926 from rust-lang-nursery/closures
...
Be careful about where we change braces in closures
2016-04-14 09:32:30 +12:00
Nick Cameron
c7780fdfd8
Be careful about where we change braces in closures
...
And some general refactoring of closure code.
Fixes #863
2016-04-14 09:05:42 +12:00
Nick Cameron
18246692c2
Merge pull request #914 from kamalmarhubi/invalid-operation-result
...
rustfmt: Make error handling more idiomatic
2016-04-14 08:40:55 +12:00
Srinivas Reddy Thatiparthy
58b022c56a
Change stdout to stderr ( #925 )
2016-04-13 21:22:45 +02:00
Nick Cameron
09440b55ef
Merge pull request #921 from matklad/more-unification
...
unify format_string and format_file
2016-04-12 11:05:06 +12:00
Nick Cameron
c6084cb29c
Fix the build
2016-04-12 11:04:33 +12:00
Nick Cameron
add81cb0a5
Merge pull request #918 from rust-lang-nursery/ty-variadic
...
Handle variadic function types
2016-04-12 10:48:08 +12:00
Nick Cameron
eadc878de0
Handle variadic function types
...
Closes #842
2016-04-12 10:47:35 +12:00
Nick Cameron
2f5f0a454a
Merge pull request #912 from rust-lang-nursery/pat-simple-mixed
...
Change the logic around breaking multiple patterns in match arms
2016-04-12 10:47:08 +12:00
Nick Cameron
ce97bc08be
Merge pull request #896 from erikjohnston/fn_arg_one_line
...
Add fn_arg_one_line option
2016-04-12 10:44:01 +12:00
Nick Cameron
5dc3283e49
Reviewer comments - mostly fix rewrite_guard
2016-04-12 10:30:57 +12:00
Nick Cameron
afc8be1d79
Change the logic around breaking multiple patterns in match arms
...
Refactor to use the list code, don't preserve original stacking-ness, base vertical vs mixed formatting on complexity of the patterns.
Closes #386
2016-04-12 09:23:37 +12:00
Aleksey Kladov
dc1fc4be0f
unify format_string and format_file
2016-04-11 22:56:54 +03:00
Nick Cameron
492b26cf04
Empty structs and struct lits ( #920 )
...
* Handle empty struct lits
Closes #835
* Don't crash on empty struct defs.
Not a great fix, but better than crashing.
2016-04-11 21:05:54 +02:00
Nick Cameron
7ac354fd09
Don't be so aggressie about line-breaking strings ( #911 )
...
We will no longer break in the middle of words, only at whitespace or punctuation.
This means we sometimes over-run, but that seems better than some of the bad splits we see.
Closes #369
2016-04-11 20:45:47 +02:00
Kamal Marhubi
72427356eb
rustfmt: Simplify match in project file lookup loop
...
This commit changes the match in `lookup_project_file` to use pattern
guards.
2016-04-10 18:42:55 -04:00
Kamal Marhubi
fe5fa874da
rustfmt: Make error handling more idiomatic
...
This commit replaces the `Operation::InvalidInput` variant with
`Result`, and uses the `try!()` macro instead of explicit matching.
2016-04-10 17:58:14 -04:00
Kamal Marhubi
b55e50f387
rustfmt: Move getopts::Options creation to its own function
2016-04-10 17:57:44 -04:00
Nick Cameron
19849fea15
Update the world
2016-04-08 15:51:06 +12:00
Nick Cameron
6cec513c67
Merge pull request #910 from kamalmarhubi/cancel-errors
...
macros: Cancel DiagnosticBuilder when not emitting error
2016-04-08 15:41:04 +12:00
Kamal Marhubi
a8c27c7086
macros: Cancel DiagnosticBuilder when not emitting error
...
The error handling in libsyntax changed to use a `DiagnosticBuilder`
type in the `Err` variant of `PResult`. This type has `emit()` and
`cancel()` methods. Once created, errors must be emitted or canceled; if
not, the `Drop` impl on `DiagnosticBuilder` will panic.
The first syntex_syntax release to include this change was v0.25.0. The
bump from v0.23.0 to v0.29.1 in #847 did not add any `cancel()` calls,
even though at least one was required. There may be others not caught in
this commit.
2016-04-07 18:05:57 -04:00