]>
git.lizzy.rs Git - rust.git/log
Nick Cameron [Wed, 11 Jul 2018 09:35:10 +0000 (21:35 +1200)]
formatting
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))
}
}
```
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
Nick Cameron [Wed, 11 Jul 2018 02:50:42 +0000 (14:50 +1200)]
chains: share code between block and visual formatters
Nick Cameron [Wed, 11 Jul 2018 01:39:35 +0000 (13:39 +1200)]
chains: refactor formatting of chain items
Nick Cameron [Wed, 11 Jul 2018 00:01:39 +0000 (12:01 +1200)]
chains: factor into objects
Nick Cameron [Tue, 10 Jul 2018 03:14:44 +0000 (15:14 +1200)]
chains: more refactoring of visual formatting
Nick Cameron [Tue, 10 Jul 2018 00:24:45 +0000 (12:24 +1200)]
chains: refactor block formatting
Nick Cameron [Mon, 9 Jul 2018 09:09:25 +0000 (21:09 +1200)]
chains: further simplification
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.
Nick Cameron [Mon, 9 Jul 2018 02:18:58 +0000 (14:18 +1200)]
chains: simplify visual formatting a bit
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
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...
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
Nick Cameron [Tue, 24 Jul 2018 02:25:17 +0000 (14:25 +1200)]
Refactoring: factor `format_lines` and `format_project` into smaller chunks
Nick Cameron [Tue, 24 Jul 2018 02:10:09 +0000 (14:10 +1200)]
Reorganise formatting.rs
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.
Nick Cameron [Mon, 23 Jul 2018 22:08:41 +0000 (10:08 +1200)]
Refactoring: move `format_project` and `Timer` out of Session
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.
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.
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.
Nick Cameron [Mon, 23 Jul 2018 02:52:02 +0000 (14:52 +1200)]
factor out a `Session` object
Nick Cameron [Mon, 23 Jul 2018 00:45:41 +0000 (12:45 +1200)]
Move non-public API from lib.rs to its own module
Nick Cameron [Sun, 22 Jul 2018 22:04:07 +0000 (10:04 +1200)]
update integration tests
Nick Cameron [Sun, 22 Jul 2018 20:29:08 +0000 (08:29 +1200)]
Merge pull request #2856 from snsmac/patch-1
Update 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
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
Nick Cameron [Fri, 20 Jul 2018 10:19:08 +0000 (22:19 +1200)]
Allow futures integration test to fail
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-*
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.
Seiichi Uchida [Fri, 20 Jul 2018 07:05:18 +0000 (16:05 +0900)]
Cargo update
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
Nick Cameron [Fri, 20 Jul 2018 02:27:56 +0000 (14:27 +1200)]
Check for comments after the `=>` in a match arm
Closes #2188
Nick Cameron [Wed, 18 Jul 2018 01:02:23 +0000 (13:02 +1200)]
Update integration tests
Nick Cameron [Wed, 18 Jul 2018 00:09:50 +0000 (12:09 +1200)]
Set rustfmt-format_macro_matchers to false by default
cc #2543
Nick Cameron [Wed, 18 Jul 2018 00:03:59 +0000 (12:03 +1200)]
Add config options for formatting macro matchers and bodies
Closes #2753
Nick Cameron [Tue, 17 Jul 2018 21:16:51 +0000 (09:16 +1200)]
`replace_with_system_newlines` doesn't need to be public
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.
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.
Nick Cameron [Tue, 17 Jul 2018 03:38:50 +0000 (15:38 +1200)]
Fix an anomaly with comments and array literals
Closes #2842
Nick Cameron [Mon, 16 Jul 2018 23:21:00 +0000 (11:21 +1200)]
Merge pull request #2790 from DevOrc/master
add emit flag documentation
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"
Nick Cameron [Mon, 16 Jul 2018 22:45:30 +0000 (10:45 +1200)]
Fix Configurations.md
Correct default for `imports_indent`
Closes #2839
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
Stéphane Campinas [Sat, 14 Jul 2018 17:17:07 +0000 (19:17 +0200)]
removed unused max_width argument of rewrite_string function
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
Seiichi Uchida [Sat, 14 Jul 2018 13:18:12 +0000 (22:18 +0900)]
0.8.3
Seiichi Uchida [Sat, 14 Jul 2018 13:16:23 +0000 (22:16 +0900)]
Cargo update (#2845)
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
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
Nick Cameron [Thu, 12 Jul 2018 10:21:07 +0000 (22:21 +1200)]
address reviewer comments
Nick Cameron [Fri, 6 Jul 2018 00:04:14 +0000 (12:04 +1200)]
Add test for #2802
Nick Cameron [Thu, 5 Jul 2018 23:58:22 +0000 (11:58 +1200)]
Fixup formatting of tests and source
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
Nick Cameron [Thu, 28 Jun 2018 00:02:05 +0000 (12:02 +1200)]
Move pair handling to its own module
Nick Cameron [Wed, 27 Jun 2018 23:50:03 +0000 (11:50 +1200)]
Factor out PairParts::infix
Nick Cameron [Mon, 9 Jul 2018 20:34:04 +0000 (08:34 +1200)]
Merge pull request #2836 from topecongiro/async-closure
Format async closure
Seiichi Uchida [Mon, 9 Jul 2018 14:20:53 +0000 (23:20 +0900)]
Format async closure
Seiichi Uchida [Mon, 9 Jul 2018 14:20:38 +0000 (23:20 +0900)]
Add a configuration guide for edition
Seiichi Uchida [Mon, 9 Jul 2018 14:20:30 +0000 (23:20 +0900)]
Add a test for async closures
Seiichi Uchida [Mon, 9 Jul 2018 14:09:14 +0000 (23:09 +0900)]
Cargo update
Add `rustc-ap-syntax_pos` to dependencies.
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
Hannes Karppila [Fri, 6 Jul 2018 21:38:32 +0000 (00:38 +0300)]
Add missing equals sign to example configuration
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
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.
Florian Walch [Mon, 2 Jul 2018 21:43:54 +0000 (23:43 +0200)]
test: Assert CRLF line endings on Windows
Florian Walch [Mon, 2 Jul 2018 21:16:17 +0000 (23:16 +0200)]
Change default newline style to "Native"
Fixes #2626.
Nick Cameron [Sun, 1 Jul 2018 21:34:55 +0000 (09:34 +1200)]
Update rustc-ap-syntax
Nick Cameron [Sun, 1 Jul 2018 20:45:09 +0000 (08:45 +1200)]
Update rustc-ap-syntax to 181
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
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
topecongiro [Sun, 1 Jul 2018 01:51:36 +0000 (10:51 +0900)]
Flatten multiple empty blocks at once
topecongiro [Sun, 1 Jul 2018 01:49:05 +0000 (10:49 +0900)]
Factor out block_can_be_flattened
topecongiro [Sun, 1 Jul 2018 01:46:32 +0000 (10:46 +0900)]
Avoid panicking on deeply nested expressions
topecongiro [Sun, 1 Jul 2018 01:40:47 +0000 (10:40 +0900)]
Add a test for #2782
topecongiro [Sun, 1 Jul 2018 00:59:53 +0000 (09:59 +0900)]
Return the trimmed original snippet when formatting macro def failed
topecongiro [Sun, 1 Jul 2018 00:59:45 +0000 (09:59 +0900)]
Add a test for #2721
Nick Cameron [Sat, 30 Jun 2018 22:57:31 +0000 (10:57 +1200)]
Merge pull request #2820 from scampi/defaults
[wip] remove some defaults
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
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
Stéphane Campinas [Sat, 30 Jun 2018 15:03:18 +0000 (17:03 +0200)]
warn on use of default value for an option
topecongiro [Sat, 30 Jun 2018 12:36:38 +0000 (21:36 +0900)]
Cargo update
Update `rustc-ap-*` to 180.0.0.
topecongiro [Sat, 30 Jun 2018 10:21:15 +0000 (19:21 +0900)]
Fix span bug when searching for the closing paren
topecongiro [Sat, 30 Jun 2018 10:20:47 +0000 (19:20 +0900)]
Add tests for #2818
topecongiro [Sat, 30 Jun 2018 06:53:28 +0000 (15:53 +0900)]
Fix compile error from breaking changes in libsyntax
topecongiro [Sat, 30 Jun 2018 06:53:22 +0000 (15:53 +0900)]
Cargo update
Nick Cameron [Thu, 28 Jun 2018 09:52:55 +0000 (21:52 +1200)]
Merge pull request #2814 from topecongiro/rustc-ap-syntax
Cargo update
Seiichi Uchida [Thu, 28 Jun 2018 07:26:10 +0000 (16:26 +0900)]
Fix compile errors from breaking changes
Seiichi Uchida [Thu, 28 Jun 2018 07:10:49 +0000 (16:10 +0900)]
Cargo update
Update `rustc-ap-*` to 177.0.0.
Seiichi Uchida [Thu, 28 Jun 2018 03:30:51 +0000 (12:30 +0900)]
Merge pull request #2809 from nrc/formatting
Some formatting fixes
Seiichi Uchida [Thu, 28 Jun 2018 03:19:03 +0000 (12:19 +0900)]
Merge pull request #2811 from bemeurer/master
Fixed typo Yess -> Yes
Bernardo Meurer [Thu, 28 Jun 2018 01:27:20 +0000 (18:27 -0700)]
Fixed typo Yess -> Yes
Stéphane Campinas [Wed, 27 Jun 2018 00:26:54 +0000 (02:26 +0200)]
unecessary use of rustfmt-normalize_comments comment
Stéphane Campinas [Tue, 26 Jun 2018 23:23:27 +0000 (01:23 +0200)]
formatting
Stéphane Campinas [Tue, 26 Jun 2018 23:11:39 +0000 (01:11 +0200)]
removed comment with default: rustfmt-remove_nested_parens
Stéphane Campinas [Tue, 26 Jun 2018 23:10:05 +0000 (01:10 +0200)]
removed comment with default: rustfmt-reorder_modules
Stéphane Campinas [Tue, 26 Jun 2018 23:05:25 +0000 (01:05 +0200)]
removed comment with default: rustfmt-imports_indent
Stéphane Campinas [Tue, 26 Jun 2018 23:01:56 +0000 (01:01 +0200)]
removed comment with default: rustfmt-reorder_imports
Stéphane Campinas [Tue, 26 Jun 2018 22:59:27 +0000 (00:59 +0200)]
removed comment with default: rustfmt-format_strings
Stéphane Campinas [Tue, 26 Jun 2018 22:55:34 +0000 (00:55 +0200)]
removed comment with default: rustfmt-control_brace_style