]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoreadme: Clarify the ways of specifying rustfmt_skip
Kamal Marhubi [Thu, 17 Mar 2016 04:51:16 +0000 (00:51 -0400)]
readme: Clarify the ways of specifying rustfmt_skip

It was previously unclear that the `cfg_attr` version works in stable
Rust.

8 years agoMerge pull request #866 from rust-lang-nursery/empty-extern
Marcus Klaas de Vries [Wed, 16 Mar 2016 17:06:25 +0000 (18:06 +0100)]
Merge pull request #866 from rust-lang-nursery/empty-extern

Keep empty extern blocks on one line

8 years agoMerge pull request #869 from ConnorGBrewster/add-trait-formatting
Nick Cameron [Tue, 15 Mar 2016 22:24:26 +0000 (11:24 +1300)]
Merge pull request #869 from ConnorGBrewster/add-trait-formatting

Add trait formatting

8 years agoFixed nitpicks
Connor Brewster [Tue, 15 Mar 2016 20:08:12 +0000 (14:08 -0600)]
Fixed nitpicks
Removed unneeded comment
Commented line wrapping conditions
Removed prefix param on `rewrite_associated_type`
Merged `rewrite_associated_static` into `rewrite_static`
Added extra tests

8 years agoFixed span_after issue
Connor Brewster [Tue, 15 Mar 2016 02:51:41 +0000 (20:51 -0600)]
Fixed span_after issue

8 years agoMerge branch 'master' of https://github.com/rust-lang-nursery/rustfmt into add-trait...
Connor Brewster [Tue, 15 Mar 2016 02:49:14 +0000 (20:49 -0600)]
Merge branch 'master' of https://github.com/rust-lang-nursery/rustfmt into add-trait-formatting

8 years agoReadded spaces to source test
Connor Brewster [Tue, 15 Mar 2016 02:11:39 +0000 (20:11 -0600)]
Readded spaces to source test

8 years agoAdded tests
Connor Brewster [Tue, 15 Mar 2016 02:05:20 +0000 (20:05 -0600)]
Added tests

8 years agoFinished implementing impl and trait type/const
Connor Brewster [Tue, 15 Mar 2016 01:52:07 +0000 (19:52 -0600)]
Finished implementing impl and trait type/const

8 years agoDon't apply the function args heuristic to tuple lits.
Nick Cameron [Mon, 14 Mar 2016 07:51:06 +0000 (20:51 +1300)]
Don't apply the function args heuristic to tuple lits.

Closes #450
Closes #510

8 years agoKeep empty extern blocks on one line
Nick Cameron [Mon, 14 Mar 2016 05:55:55 +0000 (18:55 +1300)]
Keep empty extern blocks on one line

Closes #462

8 years agocargo update
Nick Cameron [Mon, 14 Mar 2016 05:19:57 +0000 (18:19 +1300)]
cargo update

8 years agoMerge pull request #857 from kamalmarhubi/codemap-ext
Nick Cameron [Mon, 14 Mar 2016 05:00:51 +0000 (18:00 +1300)]
Merge pull request #857 from kamalmarhubi/codemap-ext

utils: Add CodeMapExt extension trait for span_* methods

8 years agoAdd independent test for Vertical rustfmt-fn_args_density
Ari Koivula [Mon, 14 Mar 2016 01:53:26 +0000 (03:53 +0200)]
Add independent test for Vertical rustfmt-fn_args_density

8 years agoFix last comment turning into block comment
Ari Koivula [Sun, 13 Mar 2016 21:27:13 +0000 (23:27 +0200)]
Fix last comment turning into block comment

This fixes the comment after the last argument in an argument list
being turned into a block comment when it's not necessary.

8 years agoAdd test for vertical fn_args_density
Ari Koivula [Sun, 13 Mar 2016 21:02:03 +0000 (23:02 +0200)]
Add test for vertical fn_args_density

8 years agoAdd Vertical fn_args_density
Ari Koivula [Sun, 13 Mar 2016 20:57:03 +0000 (22:57 +0200)]
Add Vertical fn_args_density

This adds new option Vertical to fn_args_density, which formats the
list vertically no matter what.

8 years agoutils: Add CodeMapSpanUtils trait for span_* methods
Kamal Marhubi [Mon, 7 Mar 2016 18:41:32 +0000 (13:41 -0500)]
utils: Add CodeMapSpanUtils trait for span_* methods

This commit adds a CodeMapSpanUtils extension trait on CodeMap, and
moves some functions to methods there:
  - span_after
  - span_after_last
  - span_before

This better reflects them being lookup methods on the codemap.

8 years agoMerge pull request #859 from solidsnack/master
Nick Cameron [Sun, 13 Mar 2016 22:13:46 +0000 (11:13 +1300)]
Merge pull request #859 from solidsnack/master

Write non-output to stderr when there is output

8 years agoUpdated to latest rustfmt
Connor Brewster [Sat, 12 Mar 2016 18:09:27 +0000 (11:09 -0700)]
Updated to latest rustfmt

8 years agoUncommented missed spans check
Connor Brewster [Sat, 12 Mar 2016 17:53:47 +0000 (10:53 -0700)]
Uncommented missed spans check

8 years agoRemoved unneeded pattern matching
Connor Brewster [Sat, 12 Mar 2016 05:50:30 +0000 (22:50 -0700)]
Removed unneeded pattern matching

8 years agoFixed formatting
Connor Brewster [Sat, 12 Mar 2016 05:41:22 +0000 (22:41 -0700)]
Fixed formatting

8 years agoAdded support for associated type rewriting
Connor Brewster [Sat, 12 Mar 2016 05:32:08 +0000 (22:32 -0700)]
Added support for associated type rewriting

8 years agoAdded where clause formatting
Connor Brewster [Fri, 11 Mar 2016 21:49:11 +0000 (14:49 -0700)]
Added where clause formatting

8 years agoAdding trait formatting
Connor Brewster [Fri, 11 Mar 2016 21:18:30 +0000 (14:18 -0700)]
Adding trait formatting
trait header formatting finished
generic formatting finished
added basic trait bounds formatting

8 years agoMerge pull request #851 from Amanieu/const_unsafe
Marcus Klaas de Vries [Fri, 11 Mar 2016 09:50:14 +0000 (10:50 +0100)]
Merge pull request #851 from Amanieu/const_unsafe

Fix ordering of "const unsafe fn"

8 years agoUse braces, not parens, for macro def
Jason Dusek [Fri, 11 Mar 2016 08:41:11 +0000 (00:41 -0800)]
Use braces, not parens, for macro def

8 years agoAlign arguments
Jason Dusek [Wed, 9 Mar 2016 19:03:57 +0000 (11:03 -0800)]
Align arguments

8 years agoWrite non-output to stderr when there is output
Jason Dusek [Wed, 9 Mar 2016 05:52:58 +0000 (21:52 -0800)]
Write non-output to stderr when there is output

8 years agoAdd a test for #850
Amanieu d'Antras [Thu, 3 Mar 2016 04:45:47 +0000 (04:45 +0000)]
Add a test for #850

8 years agoFix ordering of "const unsafe fn"
Amanieu d'Antras [Wed, 2 Mar 2016 15:37:20 +0000 (15:37 +0000)]
Fix ordering of "const unsafe fn"

8 years agoMerge pull request #847 from kamalmarhubi/update-syntex_syntax
Nick Cameron [Wed, 9 Mar 2016 10:31:02 +0000 (18:31 +0800)]
Merge pull request #847 from kamalmarhubi/update-syntex_syntax

deps: Update syntex_syntax to 0.29.1

8 years agoMerge pull request #841 from kamalmarhubi/operation-struct-like-enum
Marcus Klaas de Vries [Thu, 3 Mar 2016 09:27:42 +0000 (10:27 +0100)]
Merge pull request #841 from kamalmarhubi/operation-struct-like-enum

rustfmt: Use struct-like enum variants for Operation

8 years agodeps: Update syntex_syntax to 0.29.1
Kamal Marhubi [Tue, 1 Mar 2016 22:27:19 +0000 (17:27 -0500)]
deps: Update syntex_syntax to 0.29.1

8 years agorustfmt: Use struct-like enum variants for Operation
Kamal Marhubi [Thu, 25 Feb 2016 21:27:37 +0000 (16:27 -0500)]
rustfmt: Use struct-like enum variants for Operation

8 years agoMerge pull request #846 from kamalmarhubi/update-design-doc
Marcus Klaas de Vries [Wed, 2 Mar 2016 13:34:36 +0000 (14:34 +0100)]
Merge pull request #846 from kamalmarhubi/update-design-doc

doc: Update Design.md to mention syntex_syntax and config

8 years agoMerge pull request #845 from regexident/fix_811
Marcus Klaas de Vries [Wed, 2 Mar 2016 13:30:49 +0000 (14:30 +0100)]
Merge pull request #845 from regexident/fix_811

Fix for issue #811

8 years agoMerge pull request #843 from Manishearth/rustup
Marcus Klaas de Vries [Wed, 2 Mar 2016 12:10:34 +0000 (13:10 +0100)]
Merge pull request #843 from Manishearth/rustup

Upgrade deps to make it compile again

8 years agodoc: Update Design.md to mention syntex_syntax and config
Kamal Marhubi [Tue, 1 Mar 2016 17:19:37 +0000 (12:19 -0500)]
doc: Update Design.md to mention syntex_syntax and config

8 years agoFix for issue #811 (falsely inserted "::" in paths with parameterized trait cast).
Vincent Esche [Tue, 1 Mar 2016 15:39:43 +0000 (16:39 +0100)]
Fix for issue #811 (falsely inserted "::" in paths with parameterized trait cast).

8 years agoUpgrade deps to make it compile again
Manish Goregaokar [Fri, 26 Feb 2016 19:28:31 +0000 (00:58 +0530)]
Upgrade deps to make it compile again

8 years agoMerge pull request #798 from kamalmarhubi/default-no-todo-warnings
Nick Cameron [Mon, 15 Feb 2016 03:36:58 +0000 (16:36 +1300)]
Merge pull request #798 from kamalmarhubi/default-no-todo-warnings

config: Disable report_todo by default

8 years agoMerge pull request #820 from rust-lang-nursery/patterns
Nick Cameron [Sun, 14 Feb 2016 21:17:11 +0000 (10:17 +1300)]
Merge pull request #820 from rust-lang-nursery/patterns

Format all patterns (well, except macros)

8 years agoreviewer changes
Nick Cameron [Sun, 14 Feb 2016 21:07:19 +0000 (10:07 +1300)]
reviewer changes

8 years agoFormat all patterns (well, except macros)
Nick Cameron [Fri, 12 Feb 2016 01:59:13 +0000 (14:59 +1300)]
Format all patterns (well, except macros)

Fixes #18
Fixes #672

8 years agoMerge pull request #818 from kamalmarhubi/cargo-lock
Nick Cameron [Wed, 10 Feb 2016 19:55:27 +0000 (08:55 +1300)]
Merge pull request #818 from kamalmarhubi/cargo-lock

Bump version in Cargo.lock

8 years agoBump version in Cargo.lock
Kamal Marhubi [Wed, 10 Feb 2016 18:15:01 +0000 (13:15 -0500)]
Bump version in Cargo.lock

This was missed in 82a177e.

Refs #805

8 years agoVersion bump
Nick Cameron [Tue, 9 Feb 2016 04:28:45 +0000 (17:28 +1300)]
Version bump

Fixes #805

8 years agoMerge pull request #812 from kamalmarhubi/write-mode-from-config
Nick Cameron [Tue, 9 Feb 2016 04:16:54 +0000 (17:16 +1300)]
Merge pull request #812 from kamalmarhubi/write-mode-from-config

config: Use write_mode from config

8 years agoconfig: Use write_mode from config
Kamal Marhubi [Fri, 5 Feb 2016 20:59:41 +0000 (15:59 -0500)]
config: Use write_mode from config

This commit tidies up handling of `write_mode` by setting it in the
config at the start, and removing the `write_mode` parameter threaded
throughout the formatting process.

8 years agoMerge pull request #809 from andradei/patch-1
Nick Cameron [Thu, 4 Feb 2016 21:24:09 +0000 (10:24 +1300)]
Merge pull request #809 from andradei/patch-1

Correct command that lists config options

8 years agoCorrect command that lists config options
Isaac Andrade [Wed, 3 Feb 2016 23:50:39 +0000 (16:50 -0700)]
Correct command that lists config options

`cargo run -- --config-help` Simply runs a project without printing the config options.
`rustfmt --config-help` actually prints the config files.

8 years agoMerge pull request #799 from kamalmarhubi/const-instead-of-static
Nick Cameron [Wed, 3 Feb 2016 06:26:38 +0000 (19:26 +1300)]
Merge pull request #799 from kamalmarhubi/const-instead-of-static

cleanup: Use const instead of static

8 years agoMerge pull request #780 from sidred/config_path
Marcus Klaas de Vries [Wed, 3 Feb 2016 05:12:27 +0000 (06:12 +0100)]
Merge pull request #780 from sidred/config_path

Add support for the config-path option

8 years agoMerge pull request #786 from rust-lang-nursery/str-leave
Marcus Klaas de Vries [Wed, 3 Feb 2016 05:11:01 +0000 (06:11 +0100)]
Merge pull request #786 from rust-lang-nursery/str-leave

Don't reformat strings if we don't have to.

8 years agoMerge pull request #797 from kamalmarhubi/config-expect
Marcus Klaas de Vries [Wed, 3 Feb 2016 05:08:34 +0000 (06:08 +0100)]
Merge pull request #797 from kamalmarhubi/config-expect

config: Make panic messages more useful

8 years agoMerge pull request #800 from kamalmarhubi/gitignore-rust-bk
Marcus Klaas de Vries [Wed, 3 Feb 2016 05:07:53 +0000 (06:07 +0100)]
Merge pull request #800 from kamalmarhubi/gitignore-rust-bk

gitignore .rs.bk files

8 years agoMerge pull request #802 from kamalmarhubi/remove-args-doc
Marcus Klaas de Vries [Wed, 3 Feb 2016 05:07:07 +0000 (06:07 +0100)]
Merge pull request #802 from kamalmarhubi/remove-args-doc

cleanup: Remove documentation of deleted parameter

8 years agocleanup: Remove documentation of deleted parameter
Kamal Marhubi [Tue, 2 Feb 2016 17:37:38 +0000 (12:37 -0500)]
cleanup: Remove documentation of deleted parameter

The `args` parameter was removed in 579fb34.

8 years agoAdd support for the config-path option
sid [Fri, 22 Jan 2016 10:43:54 +0000 (16:13 +0530)]
Add support for the config-path option

Adds a config-path option for rustfmt. If this argument is provided,
it recursively searches the config-path for a rustfmt.toml file.
If file is not found, reverts to searching the file input path for the
config file or uses default options.

8 years agogitignore .rs.bk files
Kamal Marhubi [Tue, 2 Feb 2016 04:58:38 +0000 (23:58 -0500)]
gitignore .rs.bk files

These clutter up `git status` output when working on rustfmt.

8 years agocleanup: Use const instead of static
Kamal Marhubi [Tue, 2 Feb 2016 04:40:45 +0000 (23:40 -0500)]
cleanup: Use const instead of static

8 years agoconfig: Disable report_todo by default
Kamal Marhubi [Tue, 2 Feb 2016 01:29:44 +0000 (20:29 -0500)]
config: Disable report_todo by default

8 years agoconfig: Make panic messages more useful
Kamal Marhubi [Mon, 1 Feb 2016 23:40:32 +0000 (18:40 -0500)]
config: Make panic messages more useful

8 years agoMerge pull request #792 from kamalmarhubi/project-file-lookup-error-handling
Nick Cameron [Mon, 1 Feb 2016 19:12:50 +0000 (08:12 +1300)]
Merge pull request #792 from kamalmarhubi/project-file-lookup-error-handling

bin: Improve error handling in project file lookup

8 years agodocs: Clarify return type of lookup_project_file
Kamal Marhubi [Mon, 1 Feb 2016 17:55:12 +0000 (12:55 -0500)]
docs: Clarify return type of lookup_project_file

8 years agoMerge pull request #793 from kamalmarhubi/expect-formatting
Nick Cameron [Mon, 1 Feb 2016 04:55:30 +0000 (17:55 +1300)]
Merge pull request #793 from kamalmarhubi/expect-formatting

tests: Use Result::expect() throughout

8 years agotests: Use Result::expect() throughout
Kamal Marhubi [Sun, 31 Jan 2016 17:58:38 +0000 (12:58 -0500)]
tests: Use Result::expect() throughout

`Result::expect()` was added in Rust 1.4. Using it tidies up the code,
and also helps by printing error details, eg, printing syntax error
details if a regex fails to compile. It adds a colon followed by the
`Debug` output from any error, making the periods in messages
unnecessary.

8 years agobin: Improve error handling in project file lookup
Kamal Marhubi [Sun, 31 Jan 2016 15:21:48 +0000 (10:21 -0500)]
bin: Improve error handling in project file lookup

Previously errors were being silently ignored. Eg, if `rustfmt` did not
have permission to read a `rustfmt.toml` file, the default configuration
was used without informing the user.

8 years agoMerge pull request #787 from rust-lang-nursery/mod-empty
Marcus Klaas de Vries [Sun, 31 Jan 2016 10:33:49 +0000 (11:33 +0100)]
Merge pull request #787 from rust-lang-nursery/mod-empty

Put empty modules on one line

8 years agoMerge pull request #791 from kamalmarhubi/canonicalize-path
Marcus Klaas de Vries [Sun, 31 Jan 2016 10:33:05 +0000 (11:33 +0100)]
Merge pull request #791 from kamalmarhubi/canonicalize-path

bin: Canonicalize path before looking for project file

8 years agoMerge pull request #790 from kamalmarhubi/handle-rustfmt-toml-dir
Marcus Klaas de Vries [Sun, 31 Jan 2016 10:32:00 +0000 (11:32 +0100)]
Merge pull request #790 from kamalmarhubi/handle-rustfmt-toml-dir

bin: Properly handle a directories named rustfmt.toml

8 years agobin: Canonicalize path before looking for project file
Kamal Marhubi [Sun, 31 Jan 2016 07:01:54 +0000 (02:01 -0500)]
bin: Canonicalize path before looking for project file

8 years agobin: Properly handle a directories named rustfmt.toml
Kamal Marhubi [Sun, 31 Jan 2016 06:48:14 +0000 (01:48 -0500)]
bin: Properly handle a directories named rustfmt.toml

`lookup_project_file` could erroneously find a *directory* named
`rustmfmt.toml` if there was one in its lookup path, and so ignore any
configuration file it should have found further up. The error handling
resulted in this silently using the default configuration.

8 years agoPut empty modules on one line
Nick Cameron [Thu, 28 Jan 2016 06:53:41 +0000 (19:53 +1300)]
Put empty modules on one line

Fixes #463

8 years agoDon't reformat strings if we don't have to.
Nick Cameron [Thu, 28 Jan 2016 06:14:08 +0000 (19:14 +1300)]
Don't reformat strings if we don't have to.

Specifically if no line exceeds the allowed width and we aren't moving the string to a new offset

8 years agoMerge pull request #785 from DarkDrek/fix-#784
Nick Cameron [Wed, 27 Jan 2016 05:03:32 +0000 (18:03 +1300)]
Merge pull request #785 from DarkDrek/fix-#784

Fix for #784 edge case in comment handling

8 years agoFix #784
DarkDrek [Wed, 27 Jan 2016 01:18:05 +0000 (02:18 +0100)]
Fix #784

8 years agoMerge pull request #783 from jwazny/issue-588
Nick Cameron [Tue, 26 Jan 2016 09:23:05 +0000 (22:23 +1300)]
Merge pull request #783 from jwazny/issue-588

Added where_trailing_comma option.

8 years agoAdded tests.
Jeremy Wazny [Tue, 26 Jan 2016 05:55:51 +0000 (16:55 +1100)]
Added tests.

8 years agoLimit when we emit a trailing where clause comma.
Jeremy Wazny [Tue, 26 Jan 2016 04:53:04 +0000 (15:53 +1100)]
Limit when we emit a trailing where clause comma.

8 years agoAdded where_trailing_comma option.
Jeremy Wazny [Tue, 26 Jan 2016 01:42:11 +0000 (12:42 +1100)]
Added where_trailing_comma option.

The default is 'false', since a lot of the time there's only a single
predicate.

8 years agoMerge pull request #781 from kyeah/itemmac
Nick Cameron [Mon, 25 Jan 2016 17:54:52 +0000 (06:54 +1300)]
Merge pull request #781 from kyeah/itemmac

Format item macros

8 years agoMerge pull request #782 from markstory/readme-checkstyle
Nick Cameron [Mon, 25 Jan 2016 17:53:47 +0000 (06:53 +1300)]
Merge pull request #782 from markstory/readme-checkstyle

Update the README concerning write modes.

8 years agoAdd item macro tests
Kevin Yeh [Sun, 24 Jan 2016 19:11:18 +0000 (13:11 -0600)]
Add item macro tests

8 years agoUpdates to readme based on feedback.
Mark Story [Sat, 23 Jan 2016 16:33:50 +0000 (11:33 -0500)]
Updates to readme based on feedback.

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 agoFormat item macros
Kevin Yeh [Fri, 22 Jan 2016 19:40:26 +0000 (13:40 -0600)]
Format item macros

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.