]>
git.lizzy.rs Git - rust.git/log
Seiichi Uchida [Fri, 12 Oct 2018 15:41:17 +0000 (00:41 +0900)]
Do not add parens around lifetimes
Parens should be added only around trait objects.
Seiichi Uchida [Fri, 12 Oct 2018 15:40:34 +0000 (00:40 +0900)]
Add a test for #3060
Nick Cameron [Fri, 12 Oct 2018 02:17:27 +0000 (15:17 +1300)]
Add `attr_fn_like_width` to the width heuristics
It is a bit larger than than `fn_call_width` which we used previously, so fewer attributes get reformatted.
Closes #2929
Nick Cameron [Thu, 11 Oct 2018 21:55:45 +0000 (09:55 +1200)]
Merge pull request #3089 from topecongiro/format-comment
Add format_doc_comments
Nick Cameron [Thu, 11 Oct 2018 21:45:33 +0000 (09:45 +1200)]
Merge pull request #3086 from otavio/bump-rustc-ap-272
Update rustc-ap-* to 272.0.0
Seiichi Uchida [Thu, 11 Oct 2018 14:10:57 +0000 (23:10 +0900)]
Add format_doc_comments
Seiichi Uchida [Thu, 11 Oct 2018 13:52:17 +0000 (22:52 +0900)]
Merge pull request #3088 from otavio/fix-misleading-comment
rewrite: adjust comment as it refers to `is_if_else_block`
Otavio Salvador [Thu, 11 Oct 2018 13:21:15 +0000 (10:21 -0300)]
rewrite: adjust comment as it refers to `is_if_else_block`
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Seiichi Uchida [Thu, 11 Oct 2018 08:36:39 +0000 (17:36 +0900)]
Merge pull request #3087 from scampi/lineoverflow
fixed display message for the LineOverflow error
Stéphane Campinas [Thu, 11 Oct 2018 07:05:33 +0000 (09:05 +0200)]
fixed display message for the LineOverflow error
Otavio Salvador [Thu, 11 Oct 2018 00:53:25 +0000 (21:53 -0300)]
Update rustc-ap-* to 272.0.0
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Nick Cameron [Tue, 9 Oct 2018 22:40:18 +0000 (10:40 +1200)]
Merge pull request #3084 from otavio/issue-1990
Enable `stdin_disable_all_formatting_test` test
Nick Cameron [Tue, 9 Oct 2018 22:38:54 +0000 (10:38 +1200)]
Merge pull request #3083 from scampi/itemized_blocks
Handle itemized blocks in comments
Stéphane Campinas [Tue, 9 Oct 2018 19:47:32 +0000 (21:47 +0200)]
rewrite_string: detect when a url is being split and place the new line
after it
Seiichi Uchida [Tue, 9 Oct 2018 13:49:33 +0000 (22:49 +0900)]
Merge pull request #3085 from otavio/extend-gitignore
.gitignore: Ignore Emacs backup files
Otavio Salvador [Tue, 9 Oct 2018 12:06:16 +0000 (09:06 -0300)]
Enable `stdin_disable_all_formatting_test` test
Fixes: #1990.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Otavio Salvador [Tue, 9 Oct 2018 08:25:31 +0000 (05:25 -0300)]
.gitignore: Ignore Emacs backup files
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Stéphane Campinas [Mon, 8 Oct 2018 09:44:23 +0000 (11:44 +0200)]
handle itemized items inside comments
Nick Cameron [Mon, 8 Oct 2018 20:01:25 +0000 (08:01 +1200)]
Merge pull request #3082 from otavio/bump-dependencies
Bump dependencies
Nick Cameron [Mon, 8 Oct 2018 20:00:45 +0000 (08:00 +1200)]
Merge pull request #3080 from topecongiro/issue-3031
Format macro calls with item-like arguments
Otavio Salvador [Mon, 8 Oct 2018 17:42:54 +0000 (14:42 -0300)]
Bump rustc-ap-* to 270.0.0
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Otavio Salvador [Mon, 8 Oct 2018 17:39:16 +0000 (14:39 -0300)]
Replace `isatty` crate with `atty`
The `isatty` crate has been deprecated and a replacement has been
released for it called `atty`. It offers a nicer API and the code
change to adapt is trivial.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Stéphane Campinas [Sun, 7 Oct 2018 20:57:07 +0000 (22:57 +0200)]
rewrite_string: allow to break on a boundary character that is on edge
Stéphane Campinas [Sun, 7 Oct 2018 20:53:48 +0000 (22:53 +0200)]
rewrite_string: retain blank lines that are trailing
Stéphane Campinas [Fri, 5 Oct 2018 15:09:17 +0000 (17:09 +0200)]
rewrite_string: take care of blank lines appearing within the last line
Stéphane Campinas [Thu, 4 Oct 2018 11:56:57 +0000 (13:56 +0200)]
rewrite_string: handle newlines in the last line that fits in the shape for cases where line_start is not a whitespace
Stéphane Campinas [Thu, 4 Oct 2018 09:40:47 +0000 (11:40 +0200)]
rewrite_string: do not overflow the next line when the line_start is not a whitespace
Stéphane Campinas [Thu, 4 Oct 2018 07:16:08 +0000 (09:16 +0200)]
rewrite_string: trim trailing whitespace in case the last_line fits in the given shape
Seiichi Uchida [Mon, 8 Oct 2018 04:49:24 +0000 (13:49 +0900)]
Format a macro call with multile item-like arguments
Seiichi Uchida [Mon, 8 Oct 2018 04:40:10 +0000 (13:40 +0900)]
Format a macro call with a single item-like argument
Seiichi Uchida [Mon, 8 Oct 2018 04:38:01 +0000 (13:38 +0900)]
Add a test for #3031 and update test
No combining for an item-like macro argument.
Nick Cameron [Mon, 8 Oct 2018 01:38:49 +0000 (14:38 +1300)]
Merge pull request #3078 from YaLTeR/fix-closure-indentation
Fix inconsistent overflow behavior in Visual style
Nick Cameron [Mon, 8 Oct 2018 01:37:48 +0000 (14:37 +1300)]
Merge pull request #3077 from YaLTeR/fix-extra-commas
Get rid of extra commas in Visual struct literal formatting
Nick Cameron [Mon, 8 Oct 2018 00:05:36 +0000 (13:05 +1300)]
Merge pull request #3070 from topecongiro/issue-3030
Format a paren expr with double slash comment
Nick Cameron [Mon, 8 Oct 2018 00:04:45 +0000 (13:04 +1300)]
Merge pull request #3069 from topecongiro/issue-3003
Consider a multi-lined array as a block-like expression
Nick Cameron [Sun, 7 Oct 2018 23:38:33 +0000 (12:38 +1300)]
Merge pull request #3067 from topecongiro/refactor-toexpr
Add println!-like heuristic to the fail attribute
Nick Cameron [Sun, 7 Oct 2018 21:41:18 +0000 (10:41 +1300)]
Merge pull request #3063 from otavio/add-doc-is_doc_comment
comment: Add documentation to `is_doc_comment` public method
Seiichi Uchida [Sat, 6 Oct 2018 22:37:44 +0000 (07:37 +0900)]
Merge pull request #3079 from topecongiro/rustc-ap
Cargo update
Seiichi Uchida [Sat, 6 Oct 2018 15:52:06 +0000 (00:52 +0900)]
Fix empty types being inserted to closure
cc https://github.com/rust-lang/rust/pull/54229.
Seiichi Uchida [Sat, 6 Oct 2018 15:39:49 +0000 (00:39 +0900)]
Cargo update
Ivan Molodetskikh [Sat, 6 Oct 2018 13:32:38 +0000 (16:32 +0300)]
Overflow Visual functions even with one argument
Ivan Molodetskikh [Sat, 6 Oct 2018 08:20:46 +0000 (11:20 +0300)]
Add a test for #3049
Ivan Molodetskikh [Sat, 29 Sep 2018 09:16:03 +0000 (12:16 +0300)]
No trailing comma in struct literals (Visual)
Ivan Molodetskikh [Sat, 29 Sep 2018 08:57:06 +0000 (11:57 +0300)]
Add a test for #3066
Seiichi Uchida [Tue, 2 Oct 2018 01:29:37 +0000 (10:29 +0900)]
Merge pull request #3073 from scampi/format_strings
format_strings: take into account newline occurring within a rewritten line
Stéphane Campinas [Mon, 1 Oct 2018 22:41:56 +0000 (00:41 +0200)]
format_strings: take into account newline occurring within a rewritten line
Seiichi Uchida [Sun, 30 Sep 2018 15:07:18 +0000 (00:07 +0900)]
Format a paren expr with double slash comment
Seiichi Uchida [Sun, 30 Sep 2018 15:06:37 +0000 (00:06 +0900)]
Add a test for #3030
Seiichi Uchida [Sun, 30 Sep 2018 14:27:27 +0000 (23:27 +0900)]
Consider a multi-lined array as a block-like expression
Seiichi Uchida [Sun, 30 Sep 2018 14:27:03 +0000 (23:27 +0900)]
Add a test for #3003
and run cargo fmt.
Seiichi Uchida [Sun, 30 Sep 2018 00:10:52 +0000 (09:10 +0900)]
Update .travis.yml
Seiichi Uchida [Sat, 29 Sep 2018 23:04:34 +0000 (08:04 +0900)]
Format and update test
Seiichi Uchida [Sat, 29 Sep 2018 23:03:26 +0000 (08:03 +0900)]
Put arguments of the fail attribute on the same line as println!
Seiichi Uchida [Sat, 29 Sep 2018 23:02:55 +0000 (08:02 +0900)]
Move maybe_get_args_offset to overflow.rs
Seiichi Uchida [Sat, 29 Sep 2018 22:10:31 +0000 (07:10 +0900)]
Avoid using to_expr as much as possible
Seiichi Uchida [Sat, 29 Sep 2018 15:26:36 +0000 (00:26 +0900)]
Get rid of ToExpr trait
Seiichi Uchida [Sat, 29 Sep 2018 05:33:00 +0000 (14:33 +0900)]
Take impl Iterator for overflow routines
Otavio Salvador [Thu, 27 Sep 2018 19:45:22 +0000 (16:45 -0300)]
comment: Add documentation to `is_doc_comment` public method
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Nick Cameron [Fri, 28 Sep 2018 09:54:29 +0000 (21:54 +1200)]
Merge pull request #3061 from mehcode/feature/default-edition
Fix help message for edition config option
Nick Cameron [Fri, 28 Sep 2018 09:48:57 +0000 (21:48 +1200)]
Merge pull request #2816 from moxian/enum-discrim
Add option to vertically align enum discriminants.
Ryan Leckey [Fri, 28 Sep 2018 05:31:17 +0000 (22:31 -0700)]
Fix help message for edition config option
Seiichi Uchida [Fri, 28 Sep 2018 02:10:58 +0000 (11:10 +0900)]
Merge pull request #3050 from andrehjr/empty-impl-body-with-braces-newline
Trait Implementation - Adds a newline before the last brace on impls without a body if the first brace is also on a newline
Seiichi Uchida [Fri, 28 Sep 2018 02:08:51 +0000 (11:08 +0900)]
Merge pull request #3052 from scampi/contributing
added a note about the use of the RUST_LOG environment variable
Stéphane Campinas [Fri, 28 Sep 2018 02:06:29 +0000 (04:06 +0200)]
do not format a code block in documentation if it is annotated with ignore or text (#3058)
Stéphane Campinas [Wed, 26 Sep 2018 20:41:31 +0000 (22:41 +0200)]
added a note about the use of the RUST_LOG environment variable
moxian [Wed, 26 Sep 2018 18:29:26 +0000 (18:29 +0000)]
Change enum align semantics to care about absolute length, rather than difference.
If we're only aligning enum discriminants that are "not too far apart
(length-wise)", then this works really well for enums with
consistently-long or consistently-short idents, but not for the mixed
ones.
However, consistently-long idents is somewhate of an uncommon case and
overlong idents may be allowed to be formatted suboptimally if that
makes mixed-length idents work better (and it does in this case).
moxian [Fri, 29 Jun 2018 06:47:51 +0000 (06:47 +0000)]
Add option to vertically align enum discriminants.
André Luis Leal Cardoso Junior [Tue, 25 Sep 2018 11:53:42 +0000 (08:53 -0300)]
Makes brace behavior consistent with empty bodies for traits and impls
Adds a newline before the last brace on impls without a body if the first brace is also on a newline
Nick Cameron [Tue, 25 Sep 2018 20:55:15 +0000 (08:55 +1200)]
Update rustc_ap_syntax
Nick Cameron [Tue, 25 Sep 2018 06:23:17 +0000 (18:23 +1200)]
Remove unnecessary feature flag
Nick Cameron [Mon, 24 Sep 2018 02:22:01 +0000 (14:22 +1200)]
Merge pull request #3048 from emilio/merged-comments
lists: Detect block comment by starting from the end.
Nick Cameron [Mon, 24 Sep 2018 02:11:46 +0000 (14:11 +1200)]
Merge pull request #3045 from scampi/issue2917
Prevent right-shifting of block comments with bare lines.
Nick Cameron [Mon, 24 Sep 2018 02:07:20 +0000 (14:07 +1200)]
Merge pull request #3044 from orium/fix-too-many-modsep
Fix bug in import where two consecutive module separators were possible.
Emilio Cobos Álvarez [Sat, 22 Sep 2018 10:03:33 +0000 (12:03 +0200)]
lists: Detect block comment by starting from the end.
The issue with the current code is that comments are collapsed, so comments like
the one from the test end up in a string like:
```
"// this is a single line comment\n/* block = */"
```
I chose to fix it by detecting whether we're in a block comment starting from
the end instead, and tested a single-line comment ended in `*/` just for sanity,
ensuring line breaks are not removed in that case, which would break the
formatting.
The right fix eventually is probably to lex the comments properly, but this does
the work for now, I guess :)
Fixes #3025
Stéphane Campinas [Fri, 21 Sep 2018 22:09:11 +0000 (00:09 +0200)]
Prevent right-shifting of block comments with bare lines.
Lines that didn't start with a comment sigil were returned unchanged in
comment::rewrite_comment. Then these unchanged lines were indented in
MacroBranch::rewrite.
Diogo Sousa [Fri, 21 Sep 2018 17:46:35 +0000 (18:46 +0100)]
Fix bug in import where two consecutive module separators were possible.
Fixes #3043.
Nick Cameron [Fri, 21 Sep 2018 02:25:21 +0000 (14:25 +1200)]
Merge pull request #3042 from topecongiro/issue-3040
Do not trim a block from expression if its condition will go multi-line
Seiichi Uchida [Thu, 20 Sep 2018 15:58:47 +0000 (00:58 +0900)]
Do not trim a block from expression if its condition will go multi-line
Seiichi Uchida [Thu, 20 Sep 2018 15:57:46 +0000 (00:57 +0900)]
Add a test for #3040
Nick Cameron [Wed, 19 Sep 2018 23:36:46 +0000 (11:36 +1200)]
Merge pull request #3036 from topecongiro/issue-2932
Combine chain items only when the item gets orphaned otherwise
Nick Cameron [Wed, 19 Sep 2018 23:33:47 +0000 (11:33 +1200)]
Merge pull request #3035 from topecongiro/issue-3006
Format generics on associated types
Seiichi Uchida [Wed, 19 Sep 2018 14:22:26 +0000 (23:22 +0900)]
Cargo fmt
Seiichi Uchida [Wed, 19 Sep 2018 14:21:07 +0000 (23:21 +0900)]
Fix shape for index
Seiichi Uchida [Wed, 19 Sep 2018 14:20:43 +0000 (23:20 +0900)]
Combine chain items only when the item will get orphaned
Seiichi Uchida [Wed, 19 Sep 2018 14:19:24 +0000 (23:19 +0900)]
Update tests
Seiichi Uchida [Wed, 19 Sep 2018 13:33:10 +0000 (22:33 +0900)]
Format generics on associated types
Seiichi Uchida [Wed, 19 Sep 2018 13:20:42 +0000 (22:20 +0900)]
Add a test for #3006
Nick Cameron [Tue, 18 Sep 2018 23:31:28 +0000 (11:31 +1200)]
Merge pull request #3028 from scampi/issue2973
Fix indent computation of a macro with braces.
Nick Cameron [Tue, 18 Sep 2018 23:05:27 +0000 (11:05 +1200)]
Merge pull request #3002 from lqd/normalize-doc-attributes
normalize_doc_attributes option: convert doc attributes to comments
Nick Cameron [Tue, 18 Sep 2018 22:43:21 +0000 (10:43 +1200)]
Merge pull request #3001 from scampi/issue2977
propagate errors about failing to rewrite a macro
Nick Cameron [Tue, 18 Sep 2018 22:42:16 +0000 (10:42 +1200)]
Merge pull request #3014 from PSeitz/master
fixes #2914 by handling BadIssue case
Seiichi Uchida [Tue, 18 Sep 2018 11:21:21 +0000 (20:21 +0900)]
Merge pull request #3013 from YaLTeR/fix-issue-2985
Fix wrong shape for last chain items for indent_style = "Visual"
Nathan Sutton [Tue, 18 Sep 2018 11:20:07 +0000 (06:20 -0500)]
Improve error message when failing cargo metadata (#3024)
Seiichi Uchida [Tue, 18 Sep 2018 11:18:24 +0000 (20:18 +0900)]
Merge pull request #3019 from yangby-cryptape/fix-typo-in-readme
Fix typo in README.md.
Seiichi Uchida [Tue, 18 Sep 2018 11:17:59 +0000 (20:17 +0900)]
Merge pull request #3017 from matthiaskrgr/typo
cargo fmt: fix typo in format_crate(): (verison -> version)
Nick Cameron [Tue, 18 Sep 2018 09:12:12 +0000 (21:12 +1200)]
Merge pull request #3012 from YaLTeR/fix-issue-2496
Fix match arm block flattening
Stéphane Campinas [Mon, 17 Sep 2018 21:17:36 +0000 (23:17 +0200)]
Fix indent computation of a macro with braces.
The leading whitespace of a multine string was taken into account when
computing the `min_prefix_space_width`, even if that line couldn't be
trimmed. The consequence is it was always shifting the macro's content
to the right.
Boyu Yang [Thu, 13 Sep 2018 02:01:34 +0000 (10:01 +0800)]
Fix typo in README.md.
Rémy Rakic [Thu, 13 Sep 2018 00:40:24 +0000 (02:40 +0200)]
add test ensuring only doc = "" attributes are normalized to comments
The other shapes of doc attributes shouldn't be normalized or modified.
Rémy Rakic [Thu, 13 Sep 2018 00:27:09 +0000 (02:27 +0200)]
add tests interleaving doc attrib comments and regular comments