]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoUpdate the README concerning write modes.
Mark Story [Sat, 23 Jan 2016 03:33:59 +0000 (22:33 -0500)]
Update the README concerning write modes.

Add checkstyle and more detail on each of the write modes.

8 years agoMerge pull request #745 from markstory/checkstyle-output
Nick Cameron [Fri, 22 Jan 2016 04:48:39 +0000 (17:48 +1300)]
Merge pull request #745 from markstory/checkstyle-output

RFC implementation of checkstyle output

8 years agoExtract helper functions for testing.
Mark Story [Fri, 22 Jan 2016 03:09:01 +0000 (22:09 -0500)]
Extract helper functions for testing.

These functions help reduce duplication in the test harness and make it
easier to add tests for other write-modes in the future.

8 years agoGet checkstyle tests passing.
Mark Story [Wed, 20 Jan 2016 05:07:01 +0000 (00:07 -0500)]
Get checkstyle tests passing.

Fix up the checkstyle test so they pass. There is still an issue with
the content, but I think that is caused by a problem with how diffs are
being calculated presently.

8 years agoUpdate checkstyle write mode to take Write arguments.
Mark Story [Tue, 19 Jan 2016 05:02:21 +0000 (00:02 -0500)]
Update checkstyle write mode to take Write arguments.

By accepting Write traits we can write tests using StringBuffer.

8 years agoStart tests for checkstyle.
Mark Story [Mon, 18 Jan 2016 04:06:00 +0000 (23:06 -0500)]
Start tests for checkstyle.

They don't yet pass, I've clearly misunderstood the existing tests.

8 years agoClean up function names for checkstyle output.
Mark Story [Fri, 15 Jan 2016 03:04:24 +0000 (22:04 -0500)]
Clean up function names for checkstyle output.

8 years agoMerge pull request #774 from rust-lang-nursery/issue698
Marcus Klaas de Vries [Thu, 14 Jan 2016 18:08:46 +0000 (19:08 +0100)]
Merge pull request #774 from rust-lang-nursery/issue698

Fix an off-by-one error due to the comma in a struct lit field

8 years agoFix an off-by-one error due to the comma in a struct lit field
Nick Cameron [Thu, 14 Jan 2016 07:26:15 +0000 (20:26 +1300)]
Fix an off-by-one error due to the comma in a struct lit field

Also allows splitting the field expression on a new line after the field name.

Fixes #698

8 years agoRemove reference to 1.4 from README
Nick Cameron [Thu, 14 Jan 2016 05:39:44 +0000 (18:39 +1300)]
Remove reference to 1.4 from README

closes #771

8 years agotweak README.md
Nick Cameron [Thu, 14 Jan 2016 04:58:23 +0000 (17:58 +1300)]
tweak README.md

8 years agoUse PartialEq/Eq implementation instead of match.
Mark Story [Thu, 14 Jan 2016 01:56:35 +0000 (20:56 -0500)]
Use PartialEq/Eq implementation instead of match.

Also cleanup from rebasing onto master.

8 years agoExtract checkstyle output into a separate module.
Mark Story [Wed, 13 Jan 2016 05:22:30 +0000 (00:22 -0500)]
Extract checkstyle output into a separate module.

Rename functions a bit now that they are specific to checkstyle output.

8 years agoUpdate based on pull request feedback.
Mark Story [Sat, 9 Jan 2016 03:38:27 +0000 (22:38 -0500)]
Update based on pull request feedback.

* Extract duplicated logic.
* Make checkstyle errors into warnings.

8 years agoEncode XML entities.
Mark Story [Mon, 4 Jan 2016 04:17:49 +0000 (23:17 -0500)]
Encode XML entities.

8 years agoRemove unused argument.
Mark Story [Thu, 31 Dec 2015 05:33:51 +0000 (00:33 -0500)]
Remove unused argument.

8 years agoFix formatting errors.
Mark Story [Thu, 31 Dec 2015 05:33:07 +0000 (00:33 -0500)]
Fix formatting errors.

8 years agoHack together checkstyle output that compiles.
Mark Story [Wed, 30 Dec 2015 04:54:35 +0000 (23:54 -0500)]
Hack together checkstyle output that compiles.

I'm not sure it does something useful yet though.

8 years agoStart hacking checkstyle output in.
Mark Story [Mon, 28 Dec 2015 04:13:32 +0000 (23:13 -0500)]
Start hacking checkstyle output in.

checkstyle now shows up on the option parser, and the code still
compiles/passes tests. Next up will be outputing the XML to stdout.

8 years agoMerge pull request #769 from svmnotn/write-mode-config
Marcus Klaas de Vries [Wed, 13 Jan 2016 17:11:11 +0000 (18:11 +0100)]
Merge pull request #769 from svmnotn/write-mode-config

Allow for setting of write-mode via config file. FIxes #215

8 years agoAllow for setting of write-mode via config file. FIxes #215
Victor M. Suarez [Tue, 12 Jan 2016 23:12:48 +0000 (18:12 -0500)]
Allow for setting of write-mode via config file. FIxes #215

Also from @marcusklaas:
 Refactor code output functions

 Specifically, `write_all_files` no longer returns a HashMap. It would sometimes
 contain items, and sometimes be empty. When "fixed" newlines are required, this
 must now be done with a separate call. The tests use this strategy and should now pass!

8 years agoMerge pull request #766 from ConnorGBrewster/fix-#489
Marcus Klaas de Vries [Tue, 12 Jan 2016 21:52:34 +0000 (22:52 +0100)]
Merge pull request #766 from ConnorGBrewster/fix-#489

Added option for tighter punctuation in types. fixes #489

8 years agoMerge pull request #768 from DarkDrek/amend-to-fix-#447
Marcus Klaas de Vries [Tue, 12 Jan 2016 20:53:19 +0000 (21:53 +0100)]
Merge pull request #768 from DarkDrek/amend-to-fix-#447

fixes parsing issue #767

8 years agoAdded test case
Connor Brewster [Tue, 12 Jan 2016 20:51:32 +0000 (13:51 -0700)]
Added test case

8 years agoChanged TypeDensity::WhiteSpace to TypeDensity::Wide
Connor Brewster [Tue, 12 Jan 2016 20:42:53 +0000 (13:42 -0700)]
Changed TypeDensity::WhiteSpace to TypeDensity::Wide
Changed eq_str and plus_str assignments to use a match

8 years agoMerge pull request #757 from ConnorGBrewster/fix-#650
Marcus Klaas de Vries [Tue, 12 Jan 2016 20:17:45 +0000 (21:17 +0100)]
Merge pull request #757 from ConnorGBrewster/fix-#650

Fix for #650

8 years agofixes parsing issue #767
DarkDrek [Tue, 12 Jan 2016 20:13:59 +0000 (21:13 +0100)]
fixes parsing issue #767

8 years agoIf where is on the same line as the impl, { is put on the same line fixes #650
Connor Brewster [Sun, 10 Jan 2016 05:45:58 +0000 (22:45 -0700)]
If where is on the same line as the impl, { is put on the same line fixes #650

factored if clause into a separate function

8 years agoMerge pull request #765 from DarkDrek/fix-#447-2
Nick Cameron [Tue, 12 Jan 2016 02:41:16 +0000 (15:41 +1300)]
Merge pull request #765 from DarkDrek/fix-#447-2

Fix #447 2. try

8 years agoRemoved the failing test part since it will work when #754 is accepted
DarkDrek [Tue, 12 Jan 2016 00:32:29 +0000 (01:32 +0100)]
Removed the failing test part since it will work when #754 is accepted

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 agoAdded option for tighter punctuation in types. fixes #489
Connor Brewster [Mon, 11 Jan 2016 19:26:57 +0000 (12:26 -0700)]
Added option for tighter punctuation in types. fixes #489

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