]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAdd test for trailing newline in diff.
Utkarsh Kukreti [Fri, 17 Nov 2017 15:16:17 +0000 (20:46 +0530)]
Add test for trailing newline in diff.

Credits to @afshinm for most of the code.

6 years agoFix checkstyle test.
Utkarsh Kukreti [Fri, 17 Nov 2017 04:13:47 +0000 (09:43 +0530)]
Fix checkstyle test.

The only reason it passed before was due to a bug in the `diff` crate.
The diff was empty even though the contents of the files were different --
namely one string had a trailing newline character while the other didn't.
Now both have a trailing newline character.

6 years agoFix missing trailing newline in --write-mode=diff.
Utkarsh Kukreti [Fri, 17 Nov 2017 03:20:00 +0000 (08:50 +0530)]
Fix missing trailing newline in --write-mode=diff.

This was a bug in the `diff` crate which has been fixed in 0.1.11. This PR
simply bumps `diff` to that version.

Fixes #1753.

    $ xxd main.rs
    00000000: 666e 206d 6169 6e28 2920 7b7d            fn main() {}
    $ cargo run --bin rustfmt -- main.rs --write-mode=diff
    $ echo $?
    0
    $ git checkout issue-1753
    Switched to branch 'issue-1753'
    $ cargo run --bin rustfmt -- main.rs --write-mode=diff
    Diff in /Users/utkarsh/dev/git/rustfmt/main.rs at line 1:
     fn main() {}⏎
    +⏎
    $ echo $?
    4

6 years agoMerge pull request #2160 from topecongiro/issue-1809
Nick Cameron [Thu, 16 Nov 2017 07:59:17 +0000 (20:59 +1300)]
Merge pull request #2160 from topecongiro/issue-1809

Force vertical layout for all variants if one of then use multiple lines

6 years agoCargo fmr & update tests
topecongiro [Thu, 16 Nov 2017 07:07:15 +0000 (16:07 +0900)]
Cargo fmr & update tests

Note that we are forcing vertical layout when there are attributes on top of a
variant.

6 years agoForce vertical layout for all variants if one of then use multiple lines
topecongiro [Thu, 16 Nov 2017 07:02:01 +0000 (16:02 +0900)]
Force vertical layout for all variants if one of then use multiple lines

6 years agoAdd a test for #1809
topecongiro [Thu, 16 Nov 2017 07:01:50 +0000 (16:01 +0900)]
Add a test for #1809

6 years agoMerge pull request #2159 from topecongiro/issue-2158
Nick Cameron [Thu, 16 Nov 2017 02:59:32 +0000 (15:59 +1300)]
Merge pull request #2159 from topecongiro/issue-2158

Prevent long associated type from overflowing max width

6 years agoUse rewrite_assign_rhs() when rewriting associated type
topecongiro [Thu, 16 Nov 2017 02:27:11 +0000 (11:27 +0900)]
Use rewrite_assign_rhs() when rewriting associated type

6 years agoGeneralize rewrite_assign_rhs()
topecongiro [Thu, 16 Nov 2017 02:26:36 +0000 (11:26 +0900)]
Generalize rewrite_assign_rhs()

6 years agoAdd a test for #2158
topecongiro [Thu, 16 Nov 2017 02:26:12 +0000 (11:26 +0900)]
Add a test for #2158

6 years agoMerge pull request #2155 from topecongiro/issue-1603
Nick Cameron [Wed, 15 Nov 2017 08:17:33 +0000 (21:17 +1300)]
Merge pull request #2155 from topecongiro/issue-1603

Prevent panicking by a nested comment

6 years agoDo not get tricked by a nested comment
topecongiro [Wed, 15 Nov 2017 06:46:00 +0000 (15:46 +0900)]
Do not get tricked by a nested comment

6 years agoAdd a test for #1603
topecongiro [Wed, 15 Nov 2017 06:44:27 +0000 (15:44 +0900)]
Add a test for #1603

6 years agoUpdate README.md
Seiichi Uchida [Wed, 15 Nov 2017 06:19:32 +0000 (15:19 +0900)]
Update README.md

6 years agoMerge pull request #2154 from topecongiro/issue-2151
Nick Cameron [Wed, 15 Nov 2017 03:46:15 +0000 (16:46 +1300)]
Merge pull request #2154 from topecongiro/issue-2151

Look for a newline after match arm only when there is one

6 years agoUpdate tests
topecongiro [Wed, 15 Nov 2017 01:56:26 +0000 (10:56 +0900)]
Update tests

6 years agoLook for a newline after match arm only when there is one
topecongiro [Wed, 15 Nov 2017 01:55:40 +0000 (10:55 +0900)]
Look for a newline after match arm only when there is one

6 years agoAdd a test for #2151
topecongiro [Wed, 15 Nov 2017 01:44:51 +0000 (10:44 +0900)]
Add a test for #2151

6 years agoMerge pull request #2153 from topecongiro/issue-2152
Nick Cameron [Wed, 15 Nov 2017 02:43:03 +0000 (15:43 +1300)]
Merge pull request #2153 from topecongiro/issue-2152

Return None when a literal exceeds budget

6 years agoMerge pull request #2150 from topecongiro/audit-options/space
Nick Cameron [Wed, 15 Nov 2017 01:52:38 +0000 (14:52 +1300)]
Merge pull request #2150 from topecongiro/audit-options/space

Combine spacing-related config options into a single general one

6 years agoReturn None when a literal exceeds budget
topecongiro [Wed, 15 Nov 2017 01:36:49 +0000 (10:36 +0900)]
Return None when a literal exceeds budget

6 years agoAdd a test for #2152
topecongiro [Wed, 15 Nov 2017 01:36:42 +0000 (10:36 +0900)]
Add a test for #2152

6 years agoUpdate Configurations.md
topecongiro [Tue, 14 Nov 2017 14:47:30 +0000 (23:47 +0900)]
Update Configurations.md

6 years agoCombine spaces_within_parens and spaces_within_brackets
topecongiro [Tue, 14 Nov 2017 14:42:31 +0000 (23:42 +0900)]
Combine spaces_within_parens and spaces_within_brackets

6 years agoFix typos
topecongiro [Tue, 14 Nov 2017 14:41:33 +0000 (23:41 +0900)]
Fix typos

6 years agoUpdate tests related to spaces with parens and brackets
topecongiro [Tue, 14 Nov 2017 14:37:27 +0000 (23:37 +0900)]
Update tests related to spaces with parens and brackets

6 years agoUse space_before_colon and space_after_colon
topecongiro [Tue, 14 Nov 2017 14:25:36 +0000 (23:25 +0900)]
Use space_before_colon and space_after_colon

6 years agoUpdate tests related to colon spacing
topecongiro [Tue, 14 Nov 2017 14:25:10 +0000 (23:25 +0900)]
Update tests related to colon spacing

6 years agoMerge pull request #2148 from topecongiro/audit-option/brace_style
Nick Cameron [Tue, 14 Nov 2017 03:57:09 +0000 (16:57 +1300)]
Merge pull request #2148 from topecongiro/audit-option/brace_style

Combine fn_brace_style and item_brace_style

6 years agoMerge pull request #2137 from clippered/add-color-cli-option
Nick Cameron [Tue, 14 Nov 2017 02:11:31 +0000 (15:11 +1300)]
Merge pull request #2137 from clippered/add-color-cli-option

add cli option for color

6 years agoUpdate Configurations.md
topecongiro [Tue, 14 Nov 2017 01:49:18 +0000 (10:49 +0900)]
Update Configurations.md

6 years agoCombine fn_brace_style and item_brace_style
topecongiro [Tue, 14 Nov 2017 01:47:02 +0000 (10:47 +0900)]
Combine fn_brace_style and item_brace_style

6 years agoMerge pull request #2147 from topecongiro/audit-options/indent_style
Nick Cameron [Tue, 14 Nov 2017 00:50:43 +0000 (13:50 +1300)]
Merge pull request #2147 from topecongiro/audit-options/indent_style

Use 'indent_style' for all indent related settings

6 years agoRemove duplicated 'indent_style' section
topecongiro [Tue, 14 Nov 2017 00:31:50 +0000 (09:31 +0900)]
Remove duplicated 'indent_style' section

6 years agorename to use_colored_tty; used match as well
clippered [Mon, 13 Nov 2017 09:10:46 +0000 (20:10 +1100)]
rename to use_colored_tty; used match as well

6 years agoadd cli option for color
clippered [Thu, 9 Nov 2017 20:23:12 +0000 (07:23 +1100)]
add cli option for color

6 years agoFix chains-visual test
topecongiro [Mon, 13 Nov 2017 08:37:56 +0000 (17:37 +0900)]
Fix chains-visual test

6 years agoUpdate Configurations.md
topecongiro [Mon, 13 Nov 2017 07:52:40 +0000 (16:52 +0900)]
Update Configurations.md

6 years agoReplace '*_indent' with 'indent_style' in src
topecongiro [Mon, 13 Nov 2017 07:42:29 +0000 (16:42 +0900)]
Replace '*_indent' with 'indent_style' in src

6 years agoUpdate legacy-rustfmt.toml
topecongiro [Mon, 13 Nov 2017 07:42:15 +0000 (16:42 +0900)]
Update legacy-rustfmt.toml

6 years agoUpdate tests
topecongiro [Mon, 13 Nov 2017 07:42:04 +0000 (16:42 +0900)]
Update tests

6 years agoRemove redundant options
topecongiro [Mon, 13 Nov 2017 07:41:51 +0000 (16:41 +0900)]
Remove redundant options

6 years agoChange chain_indent to indent_style
topecongiro [Mon, 13 Nov 2017 07:25:50 +0000 (16:25 +0900)]
Change chain_indent to indent_style

6 years agoChange Legacy to Visual
topecongiro [Mon, 13 Nov 2017 07:23:21 +0000 (16:23 +0900)]
Change Legacy to Visual

6 years agoChange Rfc to Block
topecongiro [Mon, 13 Nov 2017 07:22:09 +0000 (16:22 +0900)]
Change Rfc to Block

6 years agoRecover imports_indent
topecongiro [Mon, 13 Nov 2017 07:20:44 +0000 (16:20 +0900)]
Recover imports_indent

6 years agoReplace '_indent' with 'indent_style'
topecongiro [Mon, 13 Nov 2017 07:09:59 +0000 (16:09 +0900)]
Replace '_indent' with 'indent_style'

6 years agoAdd a test for #1524
Nick Cameron [Mon, 13 Nov 2017 03:51:28 +0000 (16:51 +1300)]
Add a test for #1524

6 years agoCollapse multiple blocks in closures
Nick Cameron [Mon, 13 Nov 2017 03:45:54 +0000 (16:45 +1300)]
Collapse multiple blocks in closures

Fixes #1524

6 years agoMore closures refactoring
Nick Cameron [Mon, 13 Nov 2017 03:07:34 +0000 (16:07 +1300)]
More closures refactoring

6 years agoremove closure_block_indent_threshold option
Nick Cameron [Mon, 13 Nov 2017 02:40:16 +0000 (15:40 +1300)]
remove closure_block_indent_threshold option

6 years agoMerge pull request #2146 from topecongiro/where-on-unit-struct
Nick Cameron [Mon, 13 Nov 2017 02:28:32 +0000 (15:28 +1300)]
Merge pull request #2146 from topecongiro/where-on-unit-struct

Format where clause on unit struct

6 years agoExtract a closures module
Nick Cameron [Mon, 13 Nov 2017 02:26:33 +0000 (15:26 +1300)]
Extract a closures module

6 years agoSome basic refactoring
Nick Cameron [Mon, 13 Nov 2017 02:13:23 +0000 (15:13 +1300)]
Some basic refactoring

6 years agoFormat where clause on unit struct
topecongiro [Mon, 13 Nov 2017 02:07:09 +0000 (11:07 +0900)]
Format where clause on unit struct

6 years agoAdd BracePos
topecongiro [Mon, 13 Nov 2017 02:06:53 +0000 (11:06 +0900)]
Add BracePos

6 years agoAdd a test for where clause on unit struct
topecongiro [Mon, 13 Nov 2017 02:06:09 +0000 (11:06 +0900)]
Add a test for where clause on unit struct

6 years agoMerge pull request #2145 from topecongiro/issue-2144
Nick Cameron [Mon, 13 Nov 2017 00:01:37 +0000 (13:01 +1300)]
Merge pull request #2145 from topecongiro/issue-2144

Format generics on unit struct

6 years agoMerge pull request #2140 from topecongiro/issue-2021
Nick Cameron [Sun, 12 Nov 2017 23:21:16 +0000 (12:21 +1300)]
Merge pull request #2140 from topecongiro/issue-2021

Return 'None' when macro or string literal exceeds max width

6 years agoCargo clippy
topecongiro [Sun, 12 Nov 2017 23:02:23 +0000 (08:02 +0900)]
Cargo clippy

6 years agoFormat generics on unit struct
topecongiro [Sun, 12 Nov 2017 23:02:06 +0000 (08:02 +0900)]
Format generics on unit struct

6 years agoAdd a test for #2144
topecongiro [Sun, 12 Nov 2017 23:01:52 +0000 (08:01 +0900)]
Add a test for #2144

6 years agoMerge pull request #2143 from davidalber/add-combine-control-expr-example
Seiichi Uchida [Sun, 12 Nov 2017 22:44:37 +0000 (07:44 +0900)]
Merge pull request #2143 from davidalber/add-combine-control-expr-example

Adding an example for `combine_control_expr = false`

6 years agoAdding an example for `combine_control_expr = false`
David Alber [Sun, 12 Nov 2017 18:14:00 +0000 (10:14 -0800)]
Adding an example for `combine_control_expr = false`

Fixes #2132.

6 years agoMerge pull request #2142 from davidalber/fix-where-density-examples
Seiichi Uchida [Sun, 12 Nov 2017 11:20:17 +0000 (20:20 +0900)]
Merge pull request #2142 from davidalber/fix-where-density-examples

Updating `where_density = "Vertical"` example

6 years agoUpdating `where_density = "Vertical"` example
David Alber [Sun, 12 Nov 2017 08:16:24 +0000 (00:16 -0800)]
Updating `where_density = "Vertical"` example

The example for `where_density = "Vertical"` does not match the
current output from rustfmt. This change corrects that.

Fixes #2133.

6 years agoUpdate tests
Seiichi Uchida [Sat, 11 Nov 2017 14:16:12 +0000 (23:16 +0900)]
Update tests

6 years agoRefactor: use less vertical lines
Seiichi Uchida [Sat, 11 Nov 2017 14:15:57 +0000 (23:15 +0900)]
Refactor: use less vertical lines

6 years agoReturn None when string literal from source exceeds max width
Seiichi Uchida [Sat, 11 Nov 2017 14:15:33 +0000 (23:15 +0900)]
Return None when string literal from source exceeds max width

6 years agoReturn 'None' when macro call snippet from source exceeds max width
Seiichi Uchida [Sat, 11 Nov 2017 14:14:24 +0000 (23:14 +0900)]
Return 'None' when macro call snippet from source exceeds max width

6 years agoAdd a test for #2021
Seiichi Uchida [Sat, 11 Nov 2017 14:14:01 +0000 (23:14 +0900)]
Add a test for #2021

6 years agoMerge pull request #2138 from topecongiro/comments-around-trait-bounds
Nick Cameron [Fri, 10 Nov 2017 21:19:35 +0000 (10:19 +1300)]
Merge pull request #2138 from topecongiro/comments-around-trait-bounds

Comments around trait bounds

6 years agoMerge pull request #2136 from topecongiro/issue-2025
Nick Cameron [Fri, 10 Nov 2017 21:14:49 +0000 (10:14 +1300)]
Merge pull request #2136 from topecongiro/issue-2025

Remove empty lines at the beginning of the file

6 years agoReturn None when there are comments around trait bounds
Seiichi Uchida [Fri, 10 Nov 2017 12:21:53 +0000 (21:21 +0900)]
Return None when there are comments around trait bounds

6 years agoFix a typo
Seiichi Uchida [Fri, 10 Nov 2017 12:21:06 +0000 (21:21 +0900)]
Fix a typo

6 years agoAdd a test for #2055
Seiichi Uchida [Fri, 10 Nov 2017 12:20:54 +0000 (21:20 +0900)]
Add a test for #2055

6 years agoRemove empty lines at the beginning of the file
topecongiro [Fri, 10 Nov 2017 08:09:31 +0000 (17:09 +0900)]
Remove empty lines at the beginning of the file

6 years agoAdd opt_snippet() and opt_span_after()
topecongiro [Fri, 10 Nov 2017 08:08:57 +0000 (17:08 +0900)]
Add opt_snippet() and opt_span_after()

6 years agoUpdate tests
topecongiro [Fri, 10 Nov 2017 08:08:26 +0000 (17:08 +0900)]
Update tests

6 years agoAdd a test for #2025
topecongiro [Fri, 10 Nov 2017 08:08:16 +0000 (17:08 +0900)]
Add a test for #2025

6 years agoMerge pull request #2134 from mathstuf/configuration-fixes
Nick Cameron [Thu, 9 Nov 2017 22:16:09 +0000 (11:16 +1300)]
Merge pull request #2134 from mathstuf/configuration-fixes

Configuration fixes

6 years agoConfigurations: document report_todo and report_fixme
Ben Boeckel [Thu, 9 Nov 2017 19:10:37 +0000 (14:10 -0500)]
Configurations: document report_todo and report_fixme

6 years agoConfigurations: document reorder_extern_crates settings
Ben Boeckel [Thu, 9 Nov 2017 19:10:37 +0000 (14:10 -0500)]
Configurations: document reorder_extern_crates settings

6 years agoConfigurations: document error_on_line_overflow_comments
Ben Boeckel [Thu, 9 Nov 2017 19:10:37 +0000 (14:10 -0500)]
Configurations: document error_on_line_overflow_comments

6 years agoConfigurations: fix where_density documentation
Ben Boeckel [Thu, 9 Nov 2017 19:10:37 +0000 (14:10 -0500)]
Configurations: fix where_density documentation

The default is actually `Vertical`.

6 years agoConfigurations: add colons to example section titles
Ben Boeckel [Thu, 9 Nov 2017 19:10:37 +0000 (14:10 -0500)]
Configurations: add colons to example section titles

6 years agoConfigurations: markup `max_width`
Ben Boeckel [Thu, 9 Nov 2017 19:10:37 +0000 (14:10 -0500)]
Configurations: markup `max_width`

6 years agoMerge pull request #2130 from topecongiro/soft-wrapping-doc-comments
Nick Cameron [Thu, 9 Nov 2017 03:12:27 +0000 (16:12 +1300)]
Merge pull request #2130 from topecongiro/soft-wrapping-doc-comments

Soft wrapping doc comments

6 years agoRemove 'Option<_>' from return type of 'take_while_with_pred()'
Seiichi Uchida [Thu, 9 Nov 2017 02:33:35 +0000 (11:33 +0900)]
Remove 'Option<_>' from return type of 'take_while_with_pred()'

6 years agoIgnore editors' specific files
topecongiro [Wed, 8 Nov 2017 10:53:52 +0000 (19:53 +0900)]
Ignore editors' specific files

6 years agoUpdate a test
topecongiro [Wed, 8 Nov 2017 09:24:18 +0000 (18:24 +0900)]
Update a test

6 years agoCargo fmt
topecongiro [Wed, 8 Nov 2017 09:24:13 +0000 (18:24 +0900)]
Cargo fmt

6 years agoImplement soft wrapping on doc comments
topecongiro [Wed, 8 Nov 2017 09:24:03 +0000 (18:24 +0900)]
Implement soft wrapping on doc comments

6 years agoAdd a test for soft wrapping on doc comments
topecongiro [Wed, 8 Nov 2017 09:23:21 +0000 (18:23 +0900)]
Add a test for soft wrapping on doc comments

6 years agoMerge pull request #2129 from topecongiro/changelog
Nick Cameron [Wed, 8 Nov 2017 08:12:09 +0000 (21:12 +1300)]
Merge pull request #2129 from topecongiro/changelog

Update Changelog

6 years agoMerge pull request #2128 from topecongiro/issue-2125
Nick Cameron [Wed, 8 Nov 2017 08:11:21 +0000 (21:11 +1300)]
Merge pull request #2128 from topecongiro/issue-2125

Wrap long single field tuple struct

6 years agoFix formatting in git-fmt
Nick Cameron [Wed, 8 Nov 2017 08:10:47 +0000 (21:10 +1300)]
Fix formatting in git-fmt

6 years agoMerge pull request #2127 from topecongiro/issue-2126
Nick Cameron [Wed, 8 Nov 2017 08:02:21 +0000 (21:02 +1300)]
Merge pull request #2127 from topecongiro/issue-2126

Handle chain with a single long child with a small parent

6 years agoTweak the uncommitted file rules for git-fmt
Nick Cameron [Wed, 8 Nov 2017 05:17:12 +0000 (18:17 +1300)]
Tweak the uncommitted file rules for git-fmt