]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoHandle more possible comment position for if else
DarkDrek [Tue, 12 Jan 2016 00:09:08 +0000 (01:09 +0100)]
Handle more possible comment position for if else
Extended the test with the new possiblecomment positions

8 years agoKeep comments between if and else blocks. Fixes #447
DarkDrek [Sun, 10 Jan 2016 04:20:35 +0000 (05:20 +0100)]
Keep comments between if and else blocks. Fixes #447

8 years agoMerge pull request #762 from ConnorGBrewster/fix-#760
Nick Cameron [Tue, 12 Jan 2016 01:49:59 +0000 (14:49 +1300)]
Merge pull request #762 from ConnorGBrewster/fix-#760

Where clause is on same line as fn if fn is empty Fixes #760

8 years agoChanged is_block_empty to has_body
Connor Brewster [Mon, 11 Jan 2016 21:47:56 +0000 (14:47 -0700)]
Changed is_block_empty to has_body

8 years agoWhere clause is on same line as fn if fn is empty fix-#760
Connor Brewster [Mon, 11 Jan 2016 05:06:06 +0000 (22:06 -0700)]
Where clause is on same line as fn if fn is empty fix-#760
only applies if fn_empty_single_line is set to true

8 years agoMerge pull request #756 from cassiersg/missed-comments
cassiersg [Mon, 11 Jan 2016 00:16:52 +0000 (01:16 +0100)]
Merge pull request #756 from cassiersg/missed-comments

Detect (and recover) when comments disappear

8 years agoMerge pull request #740 from svmnotn/less_tmp_files
Nick Cameron [Sun, 10 Jan 2016 21:45:51 +0000 (10:45 +1300)]
Merge pull request #740 from svmnotn/less_tmp_files

stop creating bk files if there are no changes. Fixes #733

8 years agostop creating bk files if there are no changes. Fixes #733
Victor M. Suarez [Sun, 3 Jan 2016 04:21:55 +0000 (23:21 -0500)]
stop creating bk files if there are no changes. Fixes #733

8 years agoMerge pull request #758 from cassiersg/issue-717
Nick Cameron [Sun, 10 Jan 2016 21:24:14 +0000 (10:24 +1300)]
Merge pull request #758 from cassiersg/issue-717

Fix issue with windows line endings (#717).

8 years agoDocument comment::*CodeCharKind
Gaëtan Cassiers [Sun, 10 Jan 2016 21:04:30 +0000 (22:04 +0100)]
Document comment::*CodeCharKind

8 years agoFix issue with windows line endings (#717).
Gaëtan Cassiers [Sun, 10 Jan 2016 15:25:31 +0000 (16:25 +0100)]
Fix issue with windows line endings (#717).

The '\r' character wasn't counted in the line length.

8 years agoDetect when comments disappear
Gaëtan Cassiers [Sun, 10 Jan 2016 14:12:15 +0000 (15:12 +0100)]
Detect when comments disappear

When the reformatted code doesn't contain the same quantity of comments
as the original code, use the original code instead of the reformatted
code.
This is done for all expressions and `let` statements.

This should be used at the finest grained level possible, to avoid that
a small disappearing comment prevents a big chunk of code to be
reformatted.

Kind of fixes (avoid disappearing comments, but prevents a good
formatting is such case) #285 #225 #563 #743

8 years agoMerge pull request #749 from sanxiyn/skip-arm
Marcus Klaas de Vries [Fri, 8 Jan 2016 13:39:04 +0000 (14:39 +0100)]
Merge pull request #749 from sanxiyn/skip-arm

Add commas after skipped arms when needed

8 years agoAdd commas after skipped arms when needed
Seo Sanghyeon [Fri, 8 Jan 2016 08:03:41 +0000 (17:03 +0900)]
Add commas after skipped arms when needed

8 years agoMerge pull request #747 from Manishearth/clippy
Nick Cameron [Thu, 7 Jan 2016 07:15:49 +0000 (20:15 +1300)]
Merge pull request #747 from Manishearth/clippy

Clippy rustfmt

8 years agoClippy rustfmt
Manish Goregaokar [Thu, 7 Jan 2016 06:43:45 +0000 (12:13 +0530)]
Clippy rustfmt

8 years agoMerge pull request #744 from sanxiyn/wildcard-arm
Nick Cameron [Wed, 6 Jan 2016 03:48:11 +0000 (16:48 +1300)]
Merge pull request #744 from sanxiyn/wildcard-arm

Trailing commas for wildcard arms

8 years agoTrailing commas for wildcard arms
Seo Sanghyeon [Wed, 6 Jan 2016 02:02:01 +0000 (11:02 +0900)]
Trailing commas for wildcard arms

8 years agoMerge pull request #739 from svmnotn/case_insensitive_config_options
Nick Cameron [Mon, 4 Jan 2016 18:40:03 +0000 (07:40 +1300)]
Merge pull request #739 from svmnotn/case_insensitive_config_options

ignore case for config enums. Fixes #738

8 years agoignore case for config enums. Fixes #738
Victor M. Suarez [Sun, 3 Jan 2016 01:47:10 +0000 (20:47 -0500)]
ignore case for config enums. Fixes #738

8 years agoMerge pull request #736 from sinhpham/vsc_doc
Marcus Klaas de Vries [Sat, 2 Jan 2016 16:46:35 +0000 (17:46 +0100)]
Merge pull request #736 from sinhpham/vsc_doc

Add doc for Visual Studio Code plugins

8 years agoMerge pull request #734 from sinhpham/issue_700
Marcus Klaas de Vries [Fri, 1 Jan 2016 19:21:15 +0000 (20:21 +0100)]
Merge pull request #734 from sinhpham/issue_700

Fixed #700

8 years agoAdd doc for Visual Studio Code plugins
Sinh Pham [Fri, 1 Jan 2016 17:30:36 +0000 (09:30 -0800)]
Add doc for Visual Studio Code plugins

8 years agoFixed #700, use default color for titles and context in write-mode=diff
Sinh Pham [Thu, 31 Dec 2015 23:02:44 +0000 (15:02 -0800)]
Fixed #700, use default color for titles and context in write-mode=diff

8 years agoMerge pull request #732 from utkarshkukreti/update-diff-to-0.1.8
Marcus Klaas de Vries [Mon, 28 Dec 2015 16:45:56 +0000 (17:45 +0100)]
Merge pull request #732 from utkarshkukreti/update-diff-to-0.1.8

Update diff to 0.1.8

8 years agoAdd tests for #606.
Utkarsh Kukreti [Mon, 28 Dec 2015 11:53:34 +0000 (17:23 +0530)]
Add tests for #606.

8 years agoBump diff to 0.1.8. Fixes #606.
Utkarsh Kukreti [Mon, 28 Dec 2015 06:10:47 +0000 (11:40 +0530)]
Bump diff to 0.1.8. Fixes #606.

8 years agoMerge pull request #729 from marcusklaas/funky-self
Marcus Klaas de Vries [Sun, 27 Dec 2015 14:09:14 +0000 (15:09 +0100)]
Merge pull request #729 from marcusklaas/funky-self

Make fn argument formatting more resilient for complex self types

8 years agoMake fn argument formatting more resilient for complex self types
Marcus Klaas [Sun, 27 Dec 2015 13:25:37 +0000 (14:25 +0100)]
Make fn argument formatting more resilient for complex self types

8 years agoMerge pull request #728 from marcusklaas/typed-mut-self
Nick Cameron [Sat, 26 Dec 2015 20:18:20 +0000 (09:18 +1300)]
Merge pull request #728 from marcusklaas/typed-mut-self

format typed mut self

8 years agoMerge pull request #726 from marcusklaas/string-backslashes
Nick Cameron [Sat, 26 Dec 2015 20:15:34 +0000 (09:15 +1300)]
Merge pull request #726 from marcusklaas/string-backslashes

Prevent incorrect backslash removal in strings

8 years agoReduce dependency on pprust
Marcus Klaas [Fri, 25 Dec 2015 19:59:46 +0000 (20:59 +0100)]
Reduce dependency on pprust

8 years agoPreserve mutability for typed self arguments
Marcus Klaas [Fri, 25 Dec 2015 18:07:51 +0000 (19:07 +0100)]
Preserve mutability for typed self arguments

8 years agoPrevent incorrect backslash removal in strings
Marcus Klaas [Fri, 25 Dec 2015 17:50:40 +0000 (18:50 +0100)]
Prevent incorrect backslash removal in strings

8 years agoMerge pull request #722 from matklad/test-ignore-children
Nick Cameron [Wed, 23 Dec 2015 22:11:56 +0000 (11:11 +1300)]
Merge pull request #722 from matklad/test-ignore-children

test ignored out of line modules

8 years agotest ignored out of line modules
Aleksey Kladov [Wed, 23 Dec 2015 21:15:29 +0000 (00:15 +0300)]
test ignored out of line modules

tests #719

8 years agoMerge pull request #720 from matklad/update-lcok
Nick Cameron [Wed, 23 Dec 2015 20:34:18 +0000 (09:34 +1300)]
Merge pull request #720 from matklad/update-lcok

update Cargo.lock to match Cargo.toml

8 years agoMerge pull request #719 from matklad/ignore-child-mods
Nick Cameron [Wed, 23 Dec 2015 20:32:44 +0000 (09:32 +1300)]
Merge pull request #719 from matklad/ignore-child-mods

add option to ignore out of line modules

8 years agoupdate Cargo.lock to match Cargo.toml
Aleksey Kladov [Wed, 23 Dec 2015 14:31:54 +0000 (17:31 +0300)]
update Cargo.lock to match Cargo.toml

8 years agoadd option to ignore out of line modules
Aleksey Kladov [Wed, 23 Dec 2015 14:25:49 +0000 (17:25 +0300)]
add option to ignore out of line modules

8 years agoMerge pull request #713 from JanLikar/master
Nick Cameron [Sun, 20 Dec 2015 18:50:02 +0000 (07:50 +1300)]
Merge pull request #713 from JanLikar/master

Add verbose and quiet flags to cargo-fmt

8 years agoAdd verbose and quiet flags to cargo-fmt
Jan Likar [Sun, 20 Dec 2015 03:19:08 +0000 (04:19 +0100)]
Add verbose and quiet flags to cargo-fmt

Quiet mode supresses rustfmt's stdout, verbose mode prints targets that
are going to be formatted.

8 years agoMerge pull request #710 from JanLikar/master
Nick Cameron [Thu, 17 Dec 2015 19:43:41 +0000 (08:43 +1300)]
Merge pull request #710 from JanLikar/master

Remove `--write-mode=replace` from cargo-fmt

8 years agoRemove `--write-mode=replace` from cargo-fmt
Jan Likar [Thu, 17 Dec 2015 16:17:43 +0000 (17:17 +0100)]
Remove `--write-mode=replace` from cargo-fmt

Since replace is the default rustfmt write mode, there's no need to
call rustfmt with `--write-mode=replace`. As a bonus, it is now also
possible to override the write-mode.

8 years agoMerge pull request #704 from Sean1708/patch-1
Marcus Klaas de Vries [Wed, 16 Dec 2015 17:43:19 +0000 (18:43 +0100)]
Merge pull request #704 from Sean1708/patch-1

Fix spelling mistake in cargo-fmt usage string.

8 years agoFix spelling mistake in cargo-fmt usage string.
Sean Marshallsay [Wed, 16 Dec 2015 12:18:18 +0000 (12:18 +0000)]
Fix spelling mistake in cargo-fmt usage string.

8 years agoUse replace rather than overwrite for cargo fmt
Nick Cameron [Wed, 16 Dec 2015 05:07:59 +0000 (18:07 +1300)]
Use replace rather than overwrite for cargo fmt

8 years agomake cargo install easier
Nick Cameron [Wed, 16 Dec 2015 05:00:40 +0000 (18:00 +1300)]
make cargo install easier

8 years agoAdd quick start info to README.md, cargo update.
Nick Cameron [Wed, 16 Dec 2015 04:58:20 +0000 (17:58 +1300)]
Add quick start info to README.md, cargo update.

8 years agoMerge pull request #703 from JanLikar/cargo-fmt
Nick Cameron [Wed, 16 Dec 2015 04:51:29 +0000 (17:51 +1300)]
Merge pull request #703 from JanLikar/cargo-fmt

Add cargo-fmt binary

8 years agoAllow to pass arguments to rustfmt
Jan Likar [Wed, 16 Dec 2015 03:48:49 +0000 (04:48 +0100)]
Allow to pass arguments to rustfmt

8 years agoImprove README.md
Jan Likar [Wed, 16 Dec 2015 03:41:58 +0000 (04:41 +0100)]
Improve README.md

8 years agoReplace `locate-project` with `read-manifest`
Jan Likar [Wed, 16 Dec 2015 01:21:43 +0000 (02:21 +0100)]
Replace `locate-project` with `read-manifest`

Use `cargo read-manifest` instead of `cargo locate-project` to get
a list of files to be formatted.

8 years agoRemove unneeded dependencies
Jan Likar [Tue, 15 Dec 2015 22:57:05 +0000 (23:57 +0100)]
Remove unneeded dependencies

Remove dependency on Walkdir, which is no longer needed, because
cargo-fmt now uses cargo read-manifest to get a list of targets to
format.

8 years agoEdit README.md
Jan Likar [Tue, 15 Dec 2015 00:18:47 +0000 (01:18 +0100)]
Edit README.md

  - Add instructions for using cargo run with multiple binaries
  - Mention cargo-fmt binary

8 years agoAdd cargo-fmt binary
Jan Likar [Mon, 14 Dec 2015 14:50:19 +0000 (15:50 +0100)]
Add cargo-fmt binary

Add a new utility, which formats all readable .rs files in the src
directory of the crate using rustfmt. Both binaries can be installed
using cargo install rustfmt. cargo-fmt can be used as a Cargo
subcommand - cargo fmt.

8 years agoUpdate Cargo.lock
Jan Likar [Mon, 14 Dec 2015 14:49:46 +0000 (15:49 +0100)]
Update Cargo.lock

8 years agoChange Cargo.toml
Jan Likar [Mon, 14 Dec 2015 14:32:03 +0000 (15:32 +0100)]
Change Cargo.toml

Change Cargo.toml to include cargo-fmt's dependencies and add a
default cargo-fmt feature to enable users to only build rustfmt
if they don't need cargo-fmt.

8 years agoMerge pull request #697 from rust-lang-nursery/crates
Marcus Klaas de Vries [Sun, 13 Dec 2015 19:20:29 +0000 (20:20 +0100)]
Merge pull request #697 from rust-lang-nursery/crates

Use crates.io for everything

8 years agoFix the notes on running rustfmt
Nick Cameron [Sun, 13 Dec 2015 19:17:26 +0000 (08:17 +1300)]
Fix the notes on running rustfmt

8 years agoUse crates.io for everything
Nick Cameron [Sun, 13 Dec 2015 19:03:58 +0000 (08:03 +1300)]
Use crates.io for everything

8 years agoMerge pull request #695 from marcusklaas/string-rewrite-backslash
Nick Cameron [Sun, 13 Dec 2015 18:50:56 +0000 (07:50 +1300)]
Merge pull request #695 from marcusklaas/string-rewrite-backslash

Prevent backslash stripping in string literals

8 years agoMerge pull request #694 from marcusklaas/master1001
Nick Cameron [Sun, 13 Dec 2015 18:50:16 +0000 (07:50 +1300)]
Merge pull request #694 from marcusklaas/master1001

Don't panic on function return type rewrite failure

8 years agoPrevent backslash stripping in string literals
Marcus Klaas [Sat, 12 Dec 2015 15:20:53 +0000 (16:20 +0100)]
Prevent backslash stripping in string literals

8 years agoDon't panic on function return type rewrite failure
Marcus Klaas [Sat, 12 Dec 2015 14:41:10 +0000 (15:41 +0100)]
Don't panic on function return type rewrite failure

8 years agoMerge pull request #693 from vincenting/master
Marcus Klaas de Vries [Sat, 12 Dec 2015 13:44:31 +0000 (14:44 +0100)]
Merge pull request #693 from vincenting/master

add sublime text 3 binding plugin link

8 years agoadd sublime text 3 binding plugin link
vincenting [Sat, 12 Dec 2015 02:11:09 +0000 (10:11 +0800)]
add sublime text 3 binding plugin link

8 years agoMerge pull request #681 from rust-lang-nursery/comment-style
Nick Cameron [Wed, 9 Dec 2015 20:32:11 +0000 (09:32 +1300)]
Merge pull request #681 from rust-lang-nursery/comment-style

Add normalise_comments option.

8 years agoAdd normalise_comments option.
Nick Cameron [Tue, 8 Dec 2015 04:04:40 +0000 (17:04 +1300)]
Add normalise_comments option.

So block comments are not converted to line comments

8 years agocargo upgrade, bug fix, and prepare for packaging
Nick Cameron [Tue, 8 Dec 2015 03:19:23 +0000 (16:19 +1300)]
cargo upgrade, bug fix, and prepare for packaging

8 years agoMerge pull request #678 from marcusklaas/length-one-tuplez
Nick Cameron [Sun, 6 Dec 2015 20:01:38 +0000 (09:01 +1300)]
Merge pull request #678 from marcusklaas/length-one-tuplez

Fixed named arguments in bare function types

8 years agoMerge pull request #664 from marcusklaas/fix-reformat-failurez
Nick Cameron [Sun, 6 Dec 2015 19:33:02 +0000 (08:33 +1300)]
Merge pull request #664 from marcusklaas/fix-reformat-failurez

Don't include failed item rewrites in missed spans

8 years agoMerge pull request #668 from marcusklaas/regression-tests
Nick Cameron [Sun, 6 Dec 2015 19:10:06 +0000 (08:10 +1300)]
Merge pull request #668 from marcusklaas/regression-tests

Regression tests

8 years agoMerge pull request #666 from marcusklaas/matches-5000
Nick Cameron [Sun, 6 Dec 2015 19:07:23 +0000 (08:07 +1300)]
Merge pull request #666 from marcusklaas/matches-5000

Break function headers earlier

8 years agoMerge pull request #615 from JanLikar/version
Nick Cameron [Sun, 6 Dec 2015 18:32:16 +0000 (07:32 +1300)]
Merge pull request #615 from JanLikar/version

Add --version switch

8 years agoFixed named arguments in bare function types
Marcus Klaas [Sun, 6 Dec 2015 00:11:26 +0000 (01:11 +0100)]
Fixed named arguments in bare function types

8 years agoMerge pull request #674 from Ms2ger/start
Marcus Klaas de Vries [Fri, 4 Dec 2015 15:37:59 +0000 (16:37 +0100)]
Merge pull request #674 from Ms2ger/start

Use starts_with to avoid panics.

8 years agoMerge pull request #673 from Manishearth/clippy
Marcus Klaas de Vries [Fri, 4 Dec 2015 15:37:32 +0000 (16:37 +0100)]
Merge pull request #673 from Manishearth/clippy

Minor clippy fixes r? @nrc

8 years agoUse starts_with to avoid panics.
Ms2ger [Fri, 4 Dec 2015 15:10:14 +0000 (16:10 +0100)]
Use starts_with to avoid panics.

8 years agoMinor clippy fixes
Manish Goregaokar [Fri, 4 Dec 2015 12:32:19 +0000 (18:02 +0530)]
Minor clippy fixes

8 years agoAdd regression test for overlong trait methods
Marcus Klaas [Wed, 2 Dec 2015 20:08:09 +0000 (21:08 +0100)]
Add regression test for overlong trait methods

8 years agoAdd regression test for backslash stripping
Marcus Klaas [Wed, 2 Dec 2015 20:03:41 +0000 (21:03 +0100)]
Add regression test for backslash stripping

8 years agoMerge pull request #667 from Marwes/alias_where
Marcus Klaas de Vries [Wed, 2 Dec 2015 19:45:01 +0000 (20:45 +0100)]
Merge pull request #667 from Marwes/alias_where

Fix missed edgecases in formatting of type aliases

8 years agoDon't remove where clauses in type aliases
Markus Westerlind [Wed, 2 Dec 2015 18:39:45 +0000 (19:39 +0100)]
Don't remove where clauses in type aliases

8 years agoFix formatting of type aliases where '=' is at or close to the max width
Markus Westerlind [Wed, 2 Dec 2015 18:38:05 +0000 (19:38 +0100)]
Fix formatting of type aliases where '=' is at or close to the max width

8 years agoMerge pull request #659 from Marwes/where_clause
Marcus Klaas de Vries [Wed, 2 Dec 2015 18:06:24 +0000 (19:06 +0100)]
Merge pull request #659 from Marwes/where_clause

Fix where clauses not taking the width of the line into account

8 years agoMerge pull request #663 from SingingTree/match_trailing_comma
Marcus Klaas de Vries [Wed, 2 Dec 2015 18:05:04 +0000 (19:05 +0100)]
Merge pull request #663 from SingingTree/match_trailing_comma

WIP: Trailing commas for match block arms

8 years agoUpdate block checking code
Bryce Van Dyk [Wed, 2 Dec 2015 03:44:40 +0000 (16:44 +1300)]
Update block checking code

8 years agoBreak function headers earlier
Marcus Klaas [Tue, 1 Dec 2015 21:09:37 +0000 (22:09 +0100)]
Break function headers earlier

Closes rustfmt#295.

8 years agoAdd a BraceStyle parameter to rewrite_where_clause
Markus Westerlind [Tue, 1 Dec 2015 18:51:49 +0000 (19:51 +0100)]
Add a BraceStyle parameter to rewrite_where_clause

This allow it to exactly calculate if it needs to break the where clause into multiple lines

8 years agoUpdate trailing comma match logic, add tests
Bryce Van Dyk [Tue, 1 Dec 2015 07:10:57 +0000 (20:10 +1300)]
Update trailing comma match logic, add tests

Updates the traling comma code to attempt to handle multiline non-block bodies when
adding traling commas to blocks. Also add and update tests to cover better
the interactions between trailing commas and wrapping match arms.

8 years agoDon't include failed item rewrites in missed spans
Marcus Klaas [Mon, 30 Nov 2015 22:12:50 +0000 (23:12 +0100)]
Don't include failed item rewrites in missed spans

8 years agoTrailing commas for match block arms
Bryce Van Dyk [Mon, 30 Nov 2015 08:51:20 +0000 (21:51 +1300)]
Trailing commas for match block arms

Attempt to implement an option for trailing commas for block based match arms (issue
173). Put in place test files to verify this behaviour.

8 years agoUse the BraceStyle config to calculate the width for braces in where clasues
Markus Westerlind [Sat, 28 Nov 2015 12:59:14 +0000 (13:59 +0100)]
Use the BraceStyle config to calculate the width for braces in where clasues

8 years agoMerge pull request #662 from crumblingstatue/patch-1
Nick Cameron [Sat, 28 Nov 2015 09:14:24 +0000 (22:14 +1300)]
Merge pull request #662 from crumblingstatue/patch-1

Fix typo in README.md

8 years agoFix typo in README.md
Mika Attila [Sat, 28 Nov 2015 09:03:46 +0000 (10:03 +0100)]
Fix typo in README.md

We conform to (i.e. comply with) the Rust Style Guidelines, not confirm their validity.

8 years agoMerge pull request #660 from sanxiyn/unused-import
Nick Cameron [Fri, 27 Nov 2015 21:03:03 +0000 (10:03 +1300)]
Merge pull request #660 from sanxiyn/unused-import

Remove unused imports

8 years agoRemove unused imports
Seo Sanghyeon [Fri, 27 Nov 2015 14:38:05 +0000 (23:38 +0900)]
Remove unused imports

8 years agoFix where clauses not taking the width of the line into account
Markus Westerlind [Fri, 27 Nov 2015 08:25:31 +0000 (09:25 +0100)]
Fix where clauses not taking the width of the line into account

Fixes #630

8 years agoMerge pull request #640 from Marwes/alias
Nick Cameron [Thu, 26 Nov 2015 20:30:10 +0000 (09:30 +1300)]
Merge pull request #640 from Marwes/alias

Format type aliases