]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoOption for putting the where clause on the same line as the function if the body...
Nick Cameron [Sun, 27 Sep 2015 19:46:05 +0000 (08:46 +1300)]
Option for putting the where clause on the same line as the function if the body is empty.

8 years agoMerge pull request #379 from marcusklaas/enum-quik-fix
Nick Cameron [Sun, 27 Sep 2015 18:51:09 +0000 (07:51 +1300)]
Merge pull request #379 from marcusklaas/enum-quik-fix

Fix variant name duplication on rewrite failure

8 years agoMerge pull request #381 from marcusklaas/unchecked-sub
Marcus Klaas de Vries [Sun, 27 Sep 2015 16:11:16 +0000 (18:11 +0200)]
Merge pull request #381 from marcusklaas/unchecked-sub

Remove a few unchecked subtractions, uses of ty_to_string

8 years agoRemove a few unchecked subtractions, uses of ty_to_string
Marcus Klaas [Sun, 27 Sep 2015 15:56:38 +0000 (17:56 +0200)]
Remove a few unchecked subtractions, uses of ty_to_string

8 years agoFix variant name duplication on rewrite failure
Marcus Klaas [Sun, 27 Sep 2015 15:23:37 +0000 (17:23 +0200)]
Fix variant name duplication on rewrite failure

8 years agoMerge pull request #374 from nrc/fix-fn
Marcus Klaas de Vries [Sun, 27 Sep 2015 12:52:08 +0000 (14:52 +0200)]
Merge pull request #374 from nrc/fix-fn

Use max width for function decls, not ideal width

8 years agoMerge pull request #370 from marcusklaas/match-arm-delining
Marcus Klaas de Vries [Sun, 27 Sep 2015 10:00:57 +0000 (12:00 +0200)]
Merge pull request #370 from marcusklaas/match-arm-delining

Improve heuristics for match arm body placement

8 years agoAdd extra tests for match arm placement
Marcus Klaas [Sun, 27 Sep 2015 09:58:26 +0000 (11:58 +0200)]
Add extra tests for match arm placement

8 years agoFixup tests
Nick Cameron [Sun, 27 Sep 2015 06:39:58 +0000 (19:39 +1300)]
Fixup tests

8 years agoUse max width for function decls, etc.
Nick Cameron [Sun, 27 Sep 2015 06:30:32 +0000 (19:30 +1300)]
Use max width for function decls, etc.

We were using ideal width + leeway before. This means we can remove leeway from the config. We could remove ideal_width too, but I want to use it for comments.

8 years agoMinor refactoring in compute_budgets_for_args
Nick Cameron [Sun, 27 Sep 2015 06:25:04 +0000 (19:25 +1300)]
Minor refactoring in compute_budgets_for_args

8 years agoMerge pull request #368 from nrc/struct-wide
Nick Cameron [Sat, 26 Sep 2015 21:50:50 +0000 (10:50 +1300)]
Merge pull request #368 from nrc/struct-wide

Use a width heuristic for struct lits

8 years agoFix match arm indentation bug
Marcus Klaas [Sat, 26 Sep 2015 21:16:11 +0000 (23:16 +0200)]
Fix match arm indentation bug

8 years agoImprove heuristics for match arm body placement
Marcus Klaas [Sat, 26 Sep 2015 16:16:07 +0000 (18:16 +0200)]
Improve heuristics for match arm body placement

8 years agoMerge pull request #367 from nrc/self-alias
Marcus Klaas de Vries [Sat, 26 Sep 2015 16:25:05 +0000 (18:25 +0200)]
Merge pull request #367 from nrc/self-alias

Format imports with aliases.

8 years agoFix tests
Nick Cameron [Sat, 26 Sep 2015 06:35:17 +0000 (18:35 +1200)]
Fix tests

8 years agoChanges to rustfmt source
Nick Cameron [Sat, 26 Sep 2015 06:29:48 +0000 (18:29 +1200)]
Changes to rustfmt source

8 years agoadd test
Nick Cameron [Sat, 26 Sep 2015 06:27:51 +0000 (18:27 +1200)]
add test

8 years agoUse a width heuristic for struct lits.
Nick Cameron [Sat, 26 Sep 2015 06:25:41 +0000 (18:25 +1200)]
Use a width heuristic for struct lits.

Closes #123

8 years agoFormat imports with aliases.
Nick Cameron [Sat, 26 Sep 2015 06:12:25 +0000 (18:12 +1200)]
Format imports with aliases.

Closes #366

8 years agoMerge pull request #354 from nrc/max-fn
Nick Cameron [Sat, 26 Sep 2015 02:05:22 +0000 (14:05 +1200)]
Merge pull request #354 from nrc/max-fn

Use vertical formatting when function args width > limit

8 years agorebasing changes and address review comment
Nick Cameron [Sat, 26 Sep 2015 02:00:19 +0000 (14:00 +1200)]
rebasing changes and address review comment

8 years agoFix tests
Nick Cameron [Wed, 23 Sep 2015 23:15:08 +0000 (11:15 +1200)]
Fix tests

8 years agoChanges to source formatting
Nick Cameron [Wed, 23 Sep 2015 23:01:01 +0000 (11:01 +1200)]
Changes to source formatting

8 years agoHeuristic max width for function calls
Nick Cameron [Wed, 23 Sep 2015 23:00:14 +0000 (11:00 +1200)]
Heuristic max width for function calls

8 years agoMerge pull request #352 from nrc/ty_parens_fix
Nick Cameron [Sat, 26 Sep 2015 01:50:00 +0000 (13:50 +1200)]
Merge pull request #352 from nrc/ty_parens_fix

Formatting of some types

8 years agoFormatting of some types
Nick Cameron [Wed, 23 Sep 2015 20:36:21 +0000 (08:36 +1200)]
Formatting of some types

Closes #341

8 years agoMerge pull request #362 from marcusklaas/rewrite-string
Nick Cameron [Sat, 26 Sep 2015 01:36:59 +0000 (13:36 +1200)]
Merge pull request #362 from marcusklaas/rewrite-string

Make rewrite_string return `Option<String>`

8 years agoMerge pull request #365 from marcusklaas/format-struct-panic
Nick Cameron [Sat, 26 Sep 2015 01:35:41 +0000 (13:35 +1200)]
Merge pull request #365 from marcusklaas/format-struct-panic

Use the maximum available width in struct formatting

8 years agoUse the maximum available width in struct formatting
Marcus Klaas [Fri, 25 Sep 2015 14:53:44 +0000 (16:53 +0200)]
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`.

8 years agoMerge pull request #363 from marcusklaas/rustup35
Marcus Klaas de Vries [Fri, 25 Sep 2015 11:28:09 +0000 (13:28 +0200)]
Merge pull request #363 from marcusklaas/rustup35

Adjust for changed representation of box expressions in AST

8 years agoAdjust for changed representation of box expressions in AST
Marcus Klaas [Fri, 25 Sep 2015 11:25:52 +0000 (13:25 +0200)]
Adjust for changed representation of box expressions in AST

8 years agoMake rewrite_string return `Option<String>`
Marcus Klaas [Fri, 25 Sep 2015 10:53:25 +0000 (12:53 +0200)]
Make rewrite_string return `Option<String>`

8 years agoMerge pull request #359 from eefriedman/rewrite-addrof
Nick Cameron [Thu, 24 Sep 2015 08:30:54 +0000 (20:30 +1200)]
Merge pull request #359 from eefriedman/rewrite-addrof

Add support for formatting AddrOf (unary "&").

8 years agoAdd support for formatting AddrOf (unary "&").
Eli Friedman [Thu, 24 Sep 2015 08:13:57 +0000 (01:13 -0700)]
Add support for formatting AddrOf (unary "&").

8 years agoMerge pull request #358 from eefriedman/rewrite-return
Nick Cameron [Thu, 24 Sep 2015 06:19:37 +0000 (18:19 +1200)]
Merge pull request #358 from eefriedman/rewrite-return

Add support for formatting "return" expressions.

8 years agoAdd support for formatting "return" expressions.
Eli Friedman [Thu, 24 Sep 2015 05:51:37 +0000 (22:51 -0700)]
Add support for formatting "return" expressions.

Fixes #303.

8 years agoExhaustively enumerate expressions in expression rewriting.
Eli Friedman [Thu, 24 Sep 2015 05:51:37 +0000 (22:51 -0700)]
Exhaustively enumerate expressions in expression rewriting.

8 years agoMerge pull request #357 from scyptnex/match-comma-retention
Nick Cameron [Thu, 24 Sep 2015 02:07:39 +0000 (14:07 +1200)]
Merge pull request #357 from scyptnex/match-comma-retention

fix for #355 and test cases

8 years agofix for #355 and test cases
Scyptnex [Thu, 24 Sep 2015 02:01:48 +0000 (12:01 +1000)]
fix for #355 and test cases

8 years agoMerge pull request #347 from scyptnex/issue339-match_block_collapse
Nick Cameron [Thu, 24 Sep 2015 00:28:35 +0000 (12:28 +1200)]
Merge pull request #347 from scyptnex/issue339-match_block_collapse

match arms collapse for issue #339

8 years agoFixes #339 and #272
Scyptnex [Thu, 24 Sep 2015 00:22:06 +0000 (10:22 +1000)]
Fixes #339 and #272

8 years agoMerge pull request #349 from globin/rust-nightly-update
Nick Cameron [Wed, 23 Sep 2015 19:10:15 +0000 (07:10 +1200)]
Merge pull request #349 from globin/rust-nightly-update

Adapt to rust sytax::ast::Mac changes

8 years agoadapt to rust sytax::ast::Mac changes
Robin Gloster [Wed, 23 Sep 2015 18:31:31 +0000 (18:31 +0000)]
adapt to rust sytax::ast::Mac changes

8 years agoMerge pull request #345 from Manishearth/fix-match
Nick Cameron [Tue, 22 Sep 2015 05:00:18 +0000 (17:00 +1200)]
Merge pull request #345 from Manishearth/fix-match

Handle comments in match better (fixes #344)

8 years agoAdd tests, reformat expr
Manish Goregaokar [Tue, 22 Sep 2015 01:27:52 +0000 (06:57 +0530)]
Add tests, reformat expr

8 years agoMerge pull request #331 from marcusklaas/extern
Marcus Klaas de Vries [Mon, 21 Sep 2015 18:05:27 +0000 (20:05 +0200)]
Merge pull request #331 from marcusklaas/extern

Format foreign functions and statics

8 years agoFormat foreign functions and statics
Marcus Klaas [Mon, 21 Sep 2015 18:02:45 +0000 (20:02 +0200)]
Format foreign functions and statics

8 years agoMerge pull request #334 from marcusklaas/sparse-mods
Marcus Klaas de Vries [Mon, 21 Sep 2015 17:42:36 +0000 (19:42 +0200)]
Merge pull request #334 from marcusklaas/sparse-mods

Place the closing brace of an inline mod on a new line

8 years agoHandle comments in match better (fixes #344)
Manish Goregaokar [Mon, 21 Sep 2015 12:10:59 +0000 (17:40 +0530)]
Handle comments in match better (fixes #344)

8 years agoMerge pull request #336 from marcusklaas/struct-overflow
Nick Cameron [Sun, 20 Sep 2015 22:34:36 +0000 (10:34 +1200)]
Merge pull request #336 from marcusklaas/struct-overflow

Fix struct overflows

8 years agoFix struct overflows
Marcus Klaas [Sun, 20 Sep 2015 16:44:49 +0000 (18:44 +0200)]
Fix struct overflows

8 years agoMerge pull request #335 from Kha/struct-lit-base
Marcus Klaas de Vries [Sun, 20 Sep 2015 15:42:23 +0000 (17:42 +0200)]
Merge pull request #335 from Kha/struct-lit-base

Fix negative overflow and missing '..' on struct lit base exprs

8 years agoFix negative overflow and missing '..' on struct lit base exprs
Sebastian Ullrich [Sun, 20 Sep 2015 13:18:41 +0000 (15:18 +0200)]
Fix negative overflow and missing '..' on struct lit base exprs

8 years agoPlace the closing brace of an inline mod on a new line
Marcus Klaas [Sun, 20 Sep 2015 12:22:12 +0000 (14:22 +0200)]
Place the closing brace of an inline mod on a new line

8 years agoMerge pull request #290 from SiegeLord/tabs
Marcus Klaas de Vries [Sun, 20 Sep 2015 10:27:16 +0000 (12:27 +0200)]
Merge pull request #290 from SiegeLord/tabs

Initial implementation of hard tab indentation.

8 years agoRemove unnecessary config parameter from format_missing_with_indent.
Pavel Sountsov [Sat, 19 Sep 2015 17:44:28 +0000 (10:44 -0700)]
Remove unnecessary config parameter from format_missing_with_indent.

8 years agoAdd some tests for hard tab mode.
Pavel Sountsov [Sat, 19 Sep 2015 07:00:53 +0000 (00:00 -0700)]
Add some tests for hard tab mode.

8 years agoUse the block_indent inside visit_expr.
Pavel Sountsov [Sat, 19 Sep 2015 06:57:27 +0000 (23:57 -0700)]
Use the block_indent inside visit_expr.

This seems to pass all the tests and greatly improves the formatting output
when using hard tabs.

8 years agoAdd Indent::none(), remove make_indent.
Pavel Sountsov [Sat, 19 Sep 2015 04:50:44 +0000 (21:50 -0700)]
Add Indent::none(), remove make_indent.

8 years agoInitial implementation of hard tab indentation.
Pavel Sountsov [Sun, 6 Sep 2015 05:39:28 +0000 (22:39 -0700)]
Initial implementation of hard tab indentation.

8 years agoMerge pull request #332 from Kha/variant_no_vis
Marcus Klaas de Vries [Sat, 19 Sep 2015 17:19:34 +0000 (19:19 +0200)]
Merge pull request #332 from Kha/variant_no_vis

rustc update: Remove variant visibility

8 years agorustc update: Remove variant visibility
Sebastian Ullrich [Sat, 19 Sep 2015 15:28:00 +0000 (17:28 +0200)]
rustc update: Remove variant visibility

https://github.com/rust-lang/rust/pull/28440

8 years agoMerge pull request #326 from marcusklaas/interface-refactor
Marcus Klaas de Vries [Fri, 18 Sep 2015 20:37:09 +0000 (22:37 +0200)]
Merge pull request #326 from marcusklaas/interface-refactor

Refactor rustfmt's interface and test code

8 years agoRefactor test code
Marcus Klaas [Thu, 17 Sep 2015 18:21:06 +0000 (20:21 +0200)]
Refactor test code

No longer use callbacks or thread::catch_panic; reduce stdout spew; guard against rustfmt breaking the column limit.

8 years agoSplit formatting function from side effects
Marcus Klaas [Wed, 16 Sep 2015 19:52:32 +0000 (21:52 +0200)]
Split formatting function from side effects

This makes rustfmt more usable as a library.

8 years agoMerge pull request #314 from alobb/configDocumentation
cassiersg [Thu, 17 Sep 2015 21:13:25 +0000 (23:13 +0200)]
Merge pull request #314 from alobb/configDocumentation

Fixed https://github.com/nrc/rustfmt/issues/291

8 years agoMerge pull request #330 from marcusklaas/fn-no-return
cassiersg [Thu, 17 Sep 2015 21:09:09 +0000 (23:09 +0200)]
Merge pull request #330 from marcusklaas/fn-no-return

Add regression test for non-returning functions

8 years agoAdd regression test for non-returning functions
Marcus Klaas [Thu, 17 Sep 2015 19:35:03 +0000 (21:35 +0200)]
Add regression test for non-returning functions

8 years agoMerge pull request #324 from marcusklaas/macro-uses
Nick Cameron [Wed, 16 Sep 2015 22:46:19 +0000 (10:46 +1200)]
Merge pull request #324 from marcusklaas/macro-uses

Format macro invocations

8 years agoFormat macro invocations
Marcus Klaas [Mon, 14 Sep 2015 20:53:30 +0000 (22:53 +0200)]
Format macro invocations

8 years agoMerge pull request #323 from nrc/unsafe-closure
Marcus Klaas de Vries [Wed, 16 Sep 2015 18:02:30 +0000 (20:02 +0200)]
Merge pull request #323 from nrc/unsafe-closure

Preserve unsafe blocks in closures

8 years agoAdded help string for chains_overflow_last config parameter
Aaron Lobb [Wed, 16 Sep 2015 04:15:46 +0000 (21:15 -0700)]
Added help string for chains_overflow_last config parameter

8 years agoPreserve unsafe blocks in closures
Nick Cameron [Tue, 15 Sep 2015 05:45:54 +0000 (17:45 +1200)]
Preserve unsafe blocks in closures

Fixes #321

8 years agoMerge pull request #318 from nrc/shr_test
Nick Cameron [Mon, 14 Sep 2015 23:49:35 +0000 (11:49 +1200)]
Merge pull request #318 from nrc/shr_test

Some random tidying up

8 years agoRemove a few unnecessary `rustfmt_skip`s
Nick Cameron [Mon, 14 Sep 2015 23:42:54 +0000 (11:42 +1200)]
Remove a few unnecessary `rustfmt_skip`s

8 years agoAdd a test for dodgy spans around `>>`
Nick Cameron [Mon, 14 Sep 2015 23:40:04 +0000 (11:40 +1200)]
Add a test for dodgy spans around `>>`

Closes #242

8 years agoChanged ConfigType trait to only return a string of variants, rather than a vec
Aaron Lobb [Mon, 14 Sep 2015 20:43:55 +0000 (13:43 -0700)]
Changed ConfigType trait to only return a string of variants, rather than a vec

8 years agoMerged config imports
Aaron Lobb [Mon, 14 Sep 2015 20:06:09 +0000 (13:06 -0700)]
Merged config imports

8 years agoMerge pull request #316 from marcusklaas/diff-upgrade
Nick Cameron [Mon, 14 Sep 2015 18:32:01 +0000 (06:32 +1200)]
Merge pull request #316 from marcusklaas/diff-upgrade

Bump diff.rs version

8 years agoBump diff.rs version
Marcus Klaas [Mon, 14 Sep 2015 18:17:51 +0000 (20:17 +0200)]
Bump diff.rs version

This should make the computation of diffs quite a bit faster, which is particularly noticable in tests.

8 years agoMerge pull request #315 from alobb/defaultTomlRemoval
cassiersg [Mon, 14 Sep 2015 14:53:47 +0000 (16:53 +0200)]
Merge pull request #315 from alobb/defaultTomlRemoval

https://github.com/nrc/rustfmt/issues/304

8 years agohttps://github.com/nrc/rustfmt/issues/304 Removed reference to default.toml
Aaron Lobb [Mon, 14 Sep 2015 07:38:32 +0000 (00:38 -0700)]
https://github.com/nrc/rustfmt/issues/304 Removed reference to default.toml

8 years agoFixed https://github.com/nrc/rustfmt/issues/291; added output to --help runtime optio...
Aaron Lobb [Mon, 14 Sep 2015 07:29:15 +0000 (00:29 -0700)]
Fixed https://github.com/nrc/rustfmt/issues/291; added output to --help runtime option with possible config values

8 years agoMerge pull request #309 from marcusklaas/array-literals
Nick Cameron [Sat, 12 Sep 2015 21:20:37 +0000 (09:20 +1200)]
Merge pull request #309 from marcusklaas/array-literals

Format array literals

8 years agoMerge pull request #312 from marcusklaas/closure-fix
Nick Cameron [Sat, 12 Sep 2015 21:17:43 +0000 (09:17 +1200)]
Merge pull request #312 from marcusklaas/closure-fix

Prevent generation of bogus comment in some function calls

8 years agoPrevent generation of bogus comment in some function calls
Marcus Klaas [Sat, 12 Sep 2015 12:31:51 +0000 (14:31 +0200)]
Prevent generation of bogus comment in some function calls

This would happen when the callee contained parentheses.

8 years agoFormat array literals
Marcus Klaas [Fri, 11 Sep 2015 22:06:17 +0000 (00:06 +0200)]
Format array literals

8 years agoMerge pull request #307 from marcusklaas/function-arg-ty
Nick Cameron [Fri, 11 Sep 2015 22:01:53 +0000 (10:01 +1200)]
Merge pull request #307 from marcusklaas/function-arg-ty

Rewrite types in function arguments

8 years agoMerge pull request #310 from marcusklaas/continue-reg-test
Nick Cameron [Fri, 11 Sep 2015 21:52:10 +0000 (09:52 +1200)]
Merge pull request #310 from marcusklaas/continue-reg-test

Add regression test for bad continue span

8 years agoAdd regression test for bad continue span
Marcus Klaas [Fri, 11 Sep 2015 21:32:13 +0000 (23:32 +0200)]
Add regression test for bad continue span

8 years agoRewrite types in function arguments
Marcus Klaas [Fri, 11 Sep 2015 10:24:13 +0000 (12:24 +0200)]
Rewrite types in function arguments

8 years agoMerge pull request #216 from marcusklaas/format-fields
Marcus Klaas de Vries [Thu, 10 Sep 2015 22:56:14 +0000 (00:56 +0200)]
Merge pull request #216 from marcusklaas/format-fields

WIP: Format expression chains

8 years agoGeneral cleanup after rebase
Marcus Klaas [Thu, 10 Sep 2015 22:53:21 +0000 (00:53 +0200)]
General cleanup after rebase

8 years agoRefine chain breaking heuristics
Marcus Klaas [Wed, 9 Sep 2015 21:17:31 +0000 (23:17 +0200)]
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.

8 years agoRebase onto master
Marcus Klaas [Wed, 9 Sep 2015 21:15:37 +0000 (23:15 +0200)]
Rebase onto master

8 years agoAlign dots in chained expressions
Marcus Klaas [Wed, 9 Sep 2015 21:14:54 +0000 (23:14 +0200)]
Align dots in chained expressions

8 years agoEscape quotes in string literals
Marcus Klaas [Tue, 1 Sep 2015 21:51:57 +0000 (23:51 +0200)]
Escape quotes in string literals

8 years agoAdd some tests for match blocks
Marcus Klaas [Wed, 9 Sep 2015 21:14:09 +0000 (23:14 +0200)]
Add some tests for match blocks

8 years agoAdd tests for chain expressions
Marcus Klaas [Wed, 9 Sep 2015 21:13:37 +0000 (23:13 +0200)]
Add tests for chain expressions