]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoFormat exitential type
Seiichi Uchida [Tue, 24 Jul 2018 15:30:01 +0000 (00:30 +0900)]
Format exitential type

5 years agoAdd a simple test for exitential type
Seiichi Uchida [Tue, 24 Jul 2018 15:29:45 +0000 (00:29 +0900)]
Add a simple test for exitential type

5 years agoCargo update
Seiichi Uchida [Tue, 24 Jul 2018 15:22:27 +0000 (00:22 +0900)]
Cargo update

Update `rustc-ap-*` to "206.0.0".

5 years agoRemove `Summary`
Nick Cameron [Tue, 24 Jul 2018 09:41:49 +0000 (21:41 +1200)]
Remove `Summary`

5 years agoMerge pull request #2838 from nrc/chains
Nick Cameron [Tue, 24 Jul 2018 03:50:49 +0000 (15:50 +1200)]
Merge pull request #2838 from nrc/chains

Refactor chain formatting and fix some bugs

5 years agoReformatting after rebase
Nick Cameron [Tue, 24 Jul 2018 03:48:23 +0000 (15:48 +1200)]
Reformatting after rebase

5 years agoAdd tests
Nick Cameron [Thu, 12 Jul 2018 02:08:16 +0000 (14:08 +1200)]
Add tests

Closes #2773
Closes #2786

5 years agofixup tests
Nick Cameron [Thu, 12 Jul 2018 02:05:50 +0000 (14:05 +1200)]
fixup tests

5 years agochains: fix visual indent chain layout
Nick Cameron [Wed, 11 Jul 2018 22:44:06 +0000 (10:44 +1200)]
chains: fix visual indent chain layout

5 years agochains: treat some string lits as blocks
Nick Cameron [Wed, 11 Jul 2018 10:06:30 +0000 (22:06 +1200)]
chains: treat some string lits as blocks

5 years agoformatting
Nick Cameron [Wed, 11 Jul 2018 09:35:10 +0000 (21:35 +1200)]
formatting

5 years agochains: prefer to use the next line for an expression, if using the same line would...
Nick Cameron [Wed, 11 Jul 2018 09:01:40 +0000 (21:01 +1200)]
chains: prefer to use the next line for an expression, if using the same line would introduce an open block or similar

This problem came to light due to the chains changes, but effects other code too. It only happens rarely, e.g.,

before this fix:
```
    match foo {
        MacroArgKind::Delimited(ref delim_tok, ref args) => rewrite_delimited_inner(
            delim_tok,
            args,
        ).map(|(lhs, inner, rhs)| format!("{}{}{}", lhs, inner, rhs)),
    };

```

after:
```
    match foo {
        MacroArgKind::Delimited(ref delim_tok, ref args) => {
            rewrite_delimited_inner(delim_tok, args)
                .map(|(lhs, inner, rhs)| format!("{}{}{}", lhs, inner, rhs))
        }
    }

```

5 years agochains: minor fixups
Nick Cameron [Wed, 11 Jul 2018 02:56:26 +0000 (14:56 +1200)]
chains: minor fixups

* remove unnecessary clone
* comment formatting
* fix bug with `?` collection
* respect the heuristic if the root is more than just the parent

5 years agochains: share code between block and visual formatters
Nick Cameron [Wed, 11 Jul 2018 02:50:42 +0000 (14:50 +1200)]
chains: share code between block and visual formatters

5 years agochains: refactor formatting of chain items
Nick Cameron [Wed, 11 Jul 2018 01:39:35 +0000 (13:39 +1200)]
chains: refactor formatting of chain items

5 years agochains: factor into objects
Nick Cameron [Wed, 11 Jul 2018 00:01:39 +0000 (12:01 +1200)]
chains: factor into objects

5 years agochains: more refactoring of visual formatting
Nick Cameron [Tue, 10 Jul 2018 03:14:44 +0000 (15:14 +1200)]
chains: more refactoring of visual formatting

5 years agochains: refactor block formatting
Nick Cameron [Tue, 10 Jul 2018 00:24:45 +0000 (12:24 +1200)]
chains: refactor block formatting

5 years agochains: further simplification
Nick Cameron [Mon, 9 Jul 2018 09:09:25 +0000 (21:09 +1200)]
chains: further simplification

5 years agochains: refactoring
Nick Cameron [Mon, 9 Jul 2018 08:45:30 +0000 (20:45 +1200)]
chains: refactoring

pre-process the expression tree to get a list of chain items.

5 years agochains: simplify visual formatting a bit
Nick Cameron [Mon, 9 Jul 2018 02:18:58 +0000 (14:18 +1200)]
chains: simplify visual formatting a bit

5 years agofactor out treatment of 1-length chains
Nick Cameron [Mon, 9 Jul 2018 01:10:57 +0000 (13:10 +1200)]
factor out treatment of 1-length chains

And create `Chain` and `ChainItem` structs

5 years agochains: split handling of chains in block and visual cases
Nick Cameron [Mon, 9 Jul 2018 01:02:14 +0000 (13:02 +1200)]
chains: split handling of chains in block and visual cases

Just refactoring, lots of code dup here, but it should get better...

5 years agoChanges to chains with block indent
Nick Cameron [Sun, 8 Jul 2018 21:13:33 +0000 (09:13 +1200)]
Changes to chains with block indent

* More often combine a chain item to the previous line (if it is a block)
* Don't indent if the parent is a block

This is not perfect and doesn't pass tests, but I need to refactor to make more
progress

5 years agoRefactoring: factor `format_lines` and `format_project` into smaller chunks
Nick Cameron [Tue, 24 Jul 2018 02:25:17 +0000 (14:25 +1200)]
Refactoring: factor `format_lines` and `format_project` into smaller chunks

5 years agoReorganise formatting.rs
Nick Cameron [Tue, 24 Jul 2018 02:10:09 +0000 (14:10 +1200)]
Reorganise formatting.rs

5 years agoRefactoring: factor out `format_file` and `FormatHandler`
Nick Cameron [Mon, 23 Jul 2018 22:33:24 +0000 (10:33 +1200)]
Refactoring: factor out `format_file` and `FormatHandler`

This effectively separates out formatting from other handling.

5 years agoRefactoring: move `format_project` and `Timer` out of Session
Nick Cameron [Mon, 23 Jul 2018 22:08:41 +0000 (10:08 +1200)]
Refactoring: move `format_project` and `Timer` out of Session

5 years agoRefactoring: return a summary from `format_project`
Nick Cameron [Mon, 23 Jul 2018 21:03:31 +0000 (09:03 +1200)]
Refactoring: return a summary from `format_project`

Rather than modifying `self.summary`.

Also move some Timer methods.

5 years agoRefactoring: summary
Nick Cameron [Mon, 23 Jul 2018 20:42:33 +0000 (08:42 +1200)]
Refactoring: summary

Move the timer from Summary to Session.

Move Summary from config to formatting.

5 years agoRefactoring: move code around in formatting
Nick Cameron [Mon, 23 Jul 2018 08:01:45 +0000 (20:01 +1200)]
Refactoring: move code around in formatting

To try and make cleaner abstractions and to start to separate formatting from
other tasks.

5 years agofactor out a `Session` object
Nick Cameron [Mon, 23 Jul 2018 02:52:02 +0000 (14:52 +1200)]
factor out a `Session` object

5 years agoMove non-public API from lib.rs to its own module
Nick Cameron [Mon, 23 Jul 2018 00:45:41 +0000 (12:45 +1200)]
Move non-public API from lib.rs to its own module

5 years agoupdate integration tests
Nick Cameron [Sun, 22 Jul 2018 22:04:07 +0000 (10:04 +1200)]
update integration tests

5 years agoMerge pull request #2856 from snsmac/patch-1
Nick Cameron [Sun, 22 Jul 2018 20:29:08 +0000 (08:29 +1200)]
Merge pull request #2856 from snsmac/patch-1

Update Readme.md

5 years agoUpdate Readme.md
jr [Sun, 22 Jul 2018 11:00:33 +0000 (13:00 +0200)]
Update Readme.md

Use "rustfmt --print-config default rustfmt.toml" instead of "rustfmt --dump-default-config rustfmt.toml" to create default config

5 years agoMerge pull request #2853 from nrc/match-comment
Nick Cameron [Fri, 20 Jul 2018 10:20:35 +0000 (22:20 +1200)]
Merge pull request #2853 from nrc/match-comment

Handle missing comments in match arm and more generally

5 years agoAllow futures integration test to fail
Nick Cameron [Fri, 20 Jul 2018 10:19:08 +0000 (22:19 +1200)]
Allow futures integration test to fail

5 years agoMerge pull request #2854 from topecongiro/rustc-ap-syntax
Nick Cameron [Fri, 20 Jul 2018 10:18:03 +0000 (22:18 +1200)]
Merge pull request #2854 from topecongiro/rustc-ap-syntax

Update rustc-ap-*

5 years agoFix breaking changes
Seiichi Uchida [Fri, 20 Jul 2018 07:18:45 +0000 (16:18 +0900)]
Fix breaking changes

cc https://github.com/rust-lang/rust/pull/51829.

5 years agoCargo update
Seiichi Uchida [Fri, 20 Jul 2018 07:05:18 +0000 (16:05 +0900)]
Cargo update

5 years agoTrigger an internal error if we skip formatting due to a lost comment
Nick Cameron [Fri, 20 Jul 2018 02:42:48 +0000 (14:42 +1200)]
Trigger an internal error if we skip formatting due to a lost comment

5 years agoCheck for comments after the `=>` in a match arm
Nick Cameron [Fri, 20 Jul 2018 02:27:56 +0000 (14:27 +1200)]
Check for comments after the `=>` in a match arm

Closes #2188

5 years agoUpdate integration tests
Nick Cameron [Wed, 18 Jul 2018 01:02:23 +0000 (13:02 +1200)]
Update integration tests

5 years agoSet rustfmt-format_macro_matchers to false by default
Nick Cameron [Wed, 18 Jul 2018 00:09:50 +0000 (12:09 +1200)]
Set rustfmt-format_macro_matchers to false by default

cc #2543

5 years agoAdd config options for formatting macro matchers and bodies
Nick Cameron [Wed, 18 Jul 2018 00:03:59 +0000 (12:03 +1200)]
Add config options for formatting macro matchers and bodies

Closes #2753

5 years ago`replace_with_system_newlines` doesn't need to be public
Nick Cameron [Tue, 17 Jul 2018 21:16:51 +0000 (09:16 +1200)]
`replace_with_system_newlines` doesn't need to be public

5 years agoMerge pull request #2847 from mbebenita/max-width
Nick Cameron [Tue, 17 Jul 2018 21:06:26 +0000 (09:06 +1200)]
Merge pull request #2847 from mbebenita/max-width

Add max_width option for all heuristics.

5 years agoAdd max_width option for all heuristics.
Michael Bebenita [Tue, 17 Jul 2018 17:17:04 +0000 (13:17 -0400)]
Add max_width option for all heuristics.

This is useful when working with very small max_widths like 79 chars.

5 years agoFix an anomaly with comments and array literals
Nick Cameron [Tue, 17 Jul 2018 03:38:50 +0000 (15:38 +1200)]
Fix an anomaly with comments and array literals

Closes #2842

5 years agoMerge pull request #2790 from DevOrc/master
Nick Cameron [Mon, 16 Jul 2018 23:21:00 +0000 (11:21 +1200)]
Merge pull request #2790 from DevOrc/master

add emit flag documentation

5 years agoMerge pull request #2823 from fwalch/default-newline-style
Nick Cameron [Mon, 16 Jul 2018 23:18:10 +0000 (11:18 +1200)]
Merge pull request #2823 from fwalch/default-newline-style

Change default newline style to "Native"

5 years agoFix Configurations.md
Nick Cameron [Mon, 16 Jul 2018 22:45:30 +0000 (10:45 +1200)]
Fix Configurations.md

Correct default for `imports_indent`

Closes #2839

5 years agoMerge pull request #2829 from scampi/issue1210
Seiichi Uchida [Mon, 16 Jul 2018 07:07:05 +0000 (16:07 +0900)]
Merge pull request #2829 from scampi/issue1210

fix rewrite_string when a line feed is present in a sequence of whitespaces, resulting in strange formatting

5 years agoremoved unused max_width argument of rewrite_string function
Stéphane Campinas [Sat, 14 Jul 2018 17:17:07 +0000 (19:17 +0200)]
removed unused max_width argument of rewrite_string function

5 years agofix rewrite_string when a line feed is present in a sequence of whitespaces, resultin...
Stéphane Campinas [Sat, 7 Jul 2018 10:24:09 +0000 (12:24 +0200)]
fix rewrite_string when a line feed is present in a sequence of whitespaces, resulting in strange formatting

5 years ago0.8.3
Seiichi Uchida [Sat, 14 Jul 2018 13:18:12 +0000 (22:18 +0900)]
0.8.3

5 years agoCargo update (#2845)
Seiichi Uchida [Sat, 14 Jul 2018 13:16:23 +0000 (22:16 +0900)]
Cargo update (#2845)

5 years agoMerge pull request #2826 from nrc/complex-struct
Seiichi Uchida [Sat, 14 Jul 2018 11:28:38 +0000 (20:28 +0900)]
Merge pull request #2826 from nrc/complex-struct

Improve formatting of lists of binops

6 years agoAdd a link to ag_dubs' CI blog post to the README
Nick Cameron [Thu, 12 Jul 2018 10:28:55 +0000 (22:28 +1200)]
Add a link to ag_dubs' CI blog post to the README

6 years agoaddress reviewer comments
Nick Cameron [Thu, 12 Jul 2018 10:21:07 +0000 (22:21 +1200)]
address reviewer comments

6 years agoAdd test for #2802
Nick Cameron [Fri, 6 Jul 2018 00:04:14 +0000 (12:04 +1200)]
Add test for #2802

6 years agoFixup formatting of tests and source
Nick Cameron [Thu, 5 Jul 2018 23:58:22 +0000 (11:58 +1200)]
Fixup formatting of tests and source

6 years agoImprove formatting of series of binop expressions
Nick Cameron [Sat, 30 Jun 2018 07:53:06 +0000 (19:53 +1200)]
Improve formatting of series of binop expressions

This commit changes the handling of binops (and potentially other pairs), where
the expressions are logically a list, e.g., `a + b + c`. It makes the single
line vs multi-line approaches explicit and introduces a lowering step.

This improves formatting in a number of places, mostly improving consistency of
formatting with very short sub-expressions, but also some weird indentation.

Closes #2802

6 years agoMove pair handling to its own module
Nick Cameron [Thu, 28 Jun 2018 00:02:05 +0000 (12:02 +1200)]
Move pair handling to its own module

6 years agoFactor out PairParts::infix
Nick Cameron [Wed, 27 Jun 2018 23:50:03 +0000 (11:50 +1200)]
Factor out PairParts::infix

6 years agoMerge pull request #2836 from topecongiro/async-closure
Nick Cameron [Mon, 9 Jul 2018 20:34:04 +0000 (08:34 +1200)]
Merge pull request #2836 from topecongiro/async-closure

Format async closure

6 years agoFormat async closure
Seiichi Uchida [Mon, 9 Jul 2018 14:20:53 +0000 (23:20 +0900)]
Format async closure

6 years agoAdd a configuration guide for edition
Seiichi Uchida [Mon, 9 Jul 2018 14:20:38 +0000 (23:20 +0900)]
Add a configuration guide for edition

6 years agoAdd a test for async closures
Seiichi Uchida [Mon, 9 Jul 2018 14:20:30 +0000 (23:20 +0900)]
Add a test for async closures

6 years agoCargo update
Seiichi Uchida [Mon, 9 Jul 2018 14:09:14 +0000 (23:09 +0900)]
Cargo update

Add `rustc-ap-syntax_pos` to dependencies.

6 years agoMerge pull request #2828 from Dentosal/patch-1
Seiichi Uchida [Fri, 6 Jul 2018 23:32:42 +0000 (08:32 +0900)]
Merge pull request #2828 from Dentosal/patch-1

Add missing equals sign to example configuration

6 years agoAdd missing equals sign to example configuration
Hannes Karppila [Fri, 6 Jul 2018 21:38:32 +0000 (00:38 +0300)]
Add missing equals sign to example configuration

6 years agoMerge pull request #2827 from ehuss/help-doc
Nick Cameron [Fri, 6 Jul 2018 08:56:29 +0000 (20:56 +1200)]
Merge pull request #2827 from ehuss/help-doc

Fix help for --help=file-lines

6 years agoFix help for --help=file-lines
Eric Huss [Fri, 6 Jul 2018 05:50:23 +0000 (22:50 -0700)]
Fix help for --help=file-lines

Due to the way getopts works, it requires the equals sign.

6 years agotest: Assert CRLF line endings on Windows
Florian Walch [Mon, 2 Jul 2018 21:43:54 +0000 (23:43 +0200)]
test: Assert CRLF line endings on Windows

6 years agoChange default newline style to "Native"
Florian Walch [Mon, 2 Jul 2018 21:16:17 +0000 (23:16 +0200)]
Change default newline style to "Native"

Fixes #2626.

6 years agoUpdate rustc-ap-syntax
Nick Cameron [Sun, 1 Jul 2018 21:34:55 +0000 (09:34 +1200)]
Update rustc-ap-syntax

6 years agoUpdate rustc-ap-syntax to 181
Nick Cameron [Sun, 1 Jul 2018 20:45:09 +0000 (08:45 +1200)]
Update rustc-ap-syntax to 181

6 years agoMerge pull request #2822 from topecongiro/issue-2782
Nick Cameron [Sun, 1 Jul 2018 02:38:30 +0000 (14:38 +1200)]
Merge pull request #2822 from topecongiro/issue-2782

Avoid panicking on deeply nested expressions

6 years agoMerge pull request #2821 from topecongiro/issue-2721
Nick Cameron [Sun, 1 Jul 2018 02:37:30 +0000 (14:37 +1200)]
Merge pull request #2821 from topecongiro/issue-2721

Return the trimmed original snippet when formatting macro def failed

6 years agoFlatten multiple empty blocks at once
topecongiro [Sun, 1 Jul 2018 01:51:36 +0000 (10:51 +0900)]
Flatten multiple empty blocks at once

6 years agoFactor out block_can_be_flattened
topecongiro [Sun, 1 Jul 2018 01:49:05 +0000 (10:49 +0900)]
Factor out block_can_be_flattened

6 years agoAvoid panicking on deeply nested expressions
topecongiro [Sun, 1 Jul 2018 01:46:32 +0000 (10:46 +0900)]
Avoid panicking on deeply nested expressions

6 years agoAdd a test for #2782
topecongiro [Sun, 1 Jul 2018 01:40:47 +0000 (10:40 +0900)]
Add a test for #2782

6 years agoReturn the trimmed original snippet when formatting macro def failed
topecongiro [Sun, 1 Jul 2018 00:59:53 +0000 (09:59 +0900)]
Return the trimmed original snippet when formatting macro def failed

6 years agoAdd a test for #2721
topecongiro [Sun, 1 Jul 2018 00:59:45 +0000 (09:59 +0900)]
Add a test for #2721

6 years agoMerge pull request #2820 from scampi/defaults
Nick Cameron [Sat, 30 Jun 2018 22:57:31 +0000 (10:57 +1200)]
Merge pull request #2820 from scampi/defaults

[wip] remove some defaults

6 years agoMerge pull request #2819 from topecongiro/duplicated-paren
Nick Cameron [Sat, 30 Jun 2018 22:55:03 +0000 (10:55 +1200)]
Merge pull request #2819 from topecongiro/duplicated-paren

Avoid inserting the closing paren after tuple struct containing parentheses and a where clause

6 years agoreverted some defaults for tests that are fixing a specific issue
Stéphane Campinas [Sat, 30 Jun 2018 15:03:31 +0000 (17:03 +0200)]
reverted some defaults for tests that are fixing a specific issue

6 years agowarn on use of default value for an option
Stéphane Campinas [Sat, 30 Jun 2018 15:03:18 +0000 (17:03 +0200)]
warn on use of default value for an option

6 years agoCargo update
topecongiro [Sat, 30 Jun 2018 12:36:38 +0000 (21:36 +0900)]
Cargo update

Update `rustc-ap-*` to 180.0.0.

6 years agoFix span bug when searching for the closing paren
topecongiro [Sat, 30 Jun 2018 10:21:15 +0000 (19:21 +0900)]
Fix span bug when searching for the closing paren

6 years agoAdd tests for #2818
topecongiro [Sat, 30 Jun 2018 10:20:47 +0000 (19:20 +0900)]
Add tests for #2818

6 years agoFix compile error from breaking changes in libsyntax
topecongiro [Sat, 30 Jun 2018 06:53:28 +0000 (15:53 +0900)]
Fix compile error from breaking changes in libsyntax

6 years agoCargo update
topecongiro [Sat, 30 Jun 2018 06:53:22 +0000 (15:53 +0900)]
Cargo update

6 years agoMerge pull request #2814 from topecongiro/rustc-ap-syntax
Nick Cameron [Thu, 28 Jun 2018 09:52:55 +0000 (21:52 +1200)]
Merge pull request #2814 from topecongiro/rustc-ap-syntax

Cargo update

6 years agoFix compile errors from breaking changes
Seiichi Uchida [Thu, 28 Jun 2018 07:26:10 +0000 (16:26 +0900)]
Fix compile errors from breaking changes

6 years agoCargo update
Seiichi Uchida [Thu, 28 Jun 2018 07:10:49 +0000 (16:10 +0900)]
Cargo update

Update `rustc-ap-*` to 177.0.0.

6 years agoMerge pull request #2809 from nrc/formatting
Seiichi Uchida [Thu, 28 Jun 2018 03:30:51 +0000 (12:30 +0900)]
Merge pull request #2809 from nrc/formatting

Some formatting fixes