]>
git.lizzy.rs Git - rust.git/log
est31 [Sat, 17 Sep 2016 01:20:00 +0000 (03:20 +0200)]
Improve comment rewriting with normalize_comments == false
Only change multiline comments of the form
```rust
/*
* Text
*/
```
while not affecting comments of the form
```rust
/*
Text
*/
```
when normalize_comments is off. In the first case,
we have a known character we can align against, while
we don't have one in the second case.
Before, we have converted the second form into the first,
but this is against the spirit of normalize_comments being
turned off.
Fixes #956
est31 [Fri, 16 Sep 2016 23:44:51 +0000 (01:44 +0200)]
Add three new options for spaces
Nick Cameron [Fri, 16 Sep 2016 03:19:18 +0000 (15:19 +1200)]
Update to latest Syntex
+ Cargo update
+ 0.6.2 release
Nick Cameron [Tue, 13 Sep 2016 22:32:03 +0000 (15:32 -0700)]
Merge pull request #1151 from sinkuu/issue1021
Fix #1021: Handle `..` in tuple / tuple struct patterns
sinkuu [Tue, 6 Sep 2016 09:03:47 +0000 (18:03 +0900)]
Fix #1021: Handle `..` in tuple / tuple struct patterns
dawirstejeck [Tue, 6 Sep 2016 05:11:56 +0000 (07:11 +0200)]
Split impl at 'for' if a line break is needed (#1148)
* Split impl at 'for' if a line break is needed
* Fix formatting
* Improve comments
* Skip second try if there is no 'for'
* Restore intentional trailing whitespace
* Change test source to be incorrectly formatted
* Restore more missing trailing whitespace
* Remove too much whitespace...
Really should learn how to use git revert.
Nick Cameron [Mon, 5 Sep 2016 04:05:58 +0000 (16:05 +1200)]
Merge pull request #1147 from brettcannon/patch-1
Put rustfmt on PATH so `cargo fmt` works on Travis
Brett Cannon [Sun, 4 Sep 2016 00:30:02 +0000 (17:30 -0700)]
Put rustfmt on PATH so `cargo fmt` works on Travis
Closes #1143
Nick Cameron [Mon, 29 Aug 2016 03:01:48 +0000 (15:01 +1200)]
Merge pull request #1135 from sinkuu/clippy
Run clippy
sinkuu [Tue, 23 Aug 2016 14:14:45 +0000 (23:14 +0900)]
Run clippy
Nick Cameron [Sun, 28 Aug 2016 19:07:48 +0000 (07:07 +1200)]
Merge pull request #1134 from sinkuu/issue977
Fix #977
sinkuu [Tue, 23 Aug 2016 12:00:43 +0000 (21:00 +0900)]
Fix #977
Nick Cameron [Sun, 28 Aug 2016 05:48:31 +0000 (17:48 +1200)]
Merge pull request #1142 from kamalmarhubi/fix-1140
Check term supports colour before printing fancy diffs
Kamal Marhubi [Fri, 26 Aug 2016 21:08:47 +0000 (17:08 -0400)]
Check term supports colour before printing fancy diffs
For a terminal like DUMB, we were still attempting to print colourful
diffs, which failed with a `NotSupported` error.
Fixes #1140
Nick Cameron [Thu, 25 Aug 2016 05:30:03 +0000 (17:30 +1200)]
Merge pull request #1138 from johannhof/travis-docs
Add instructions on how to run rustfmt on Travis
Johann Hofmann [Wed, 24 Aug 2016 19:25:31 +0000 (21:25 +0200)]
Add instructions on how to run rustfmt on Travis
This adds very simplistic instructions on how to run rustfmt on CI.
I also wrote a blog post for more details: http://johannh.me/blog/rustfmt-ci.html
Stuart Dootson [Wed, 24 Aug 2016 20:32:04 +0000 (21:32 +0100)]
Fix issue 1124 - detect start of output rather than start of input file when writing output source file (#1133)
* Change required to prevent a trailing space at the end of a separate module being propagated
* Detect the start of the output file rather than the start of the input file when deciding whether to output preceding snippets - this stops unnecessary whitespace and blank lines from being inserted when spans and statements are output in an order other than that from the input file.
* Add code to prevent space from being added with the prefix snippet if a) the snippet is entirely horizontal whitespace, or b) the snippet contains whitespace followed by a newline. This prevents trailing spaces at the end of a line from being added.
* Tests for this issue
* Tidy up `match` statements
* Add test with blank lines between `use` statements
Nick Cameron [Wed, 10 Aug 2016 21:53:58 +0000 (09:53 +1200)]
v0.6.0
Nick Cameron [Wed, 10 Aug 2016 09:52:46 +0000 (21:52 +1200)]
Merge pull request #1123 from juicejitsu/807
Don't emit filename in diff mode, add filename to diff metadata
Stuart Dootson [Wed, 10 Aug 2016 06:13:27 +0000 (08:13 +0200)]
Fix #1120 - rework how the use list prefix is determined. (#1121)
* Fix #1120 - rework how the use list prefix is determined.
* Added test commentary & another test case
Nick Cameron [Wed, 10 Aug 2016 06:12:16 +0000 (18:12 +1200)]
Merge pull request #1122 from studoot/add-test-for-1111
Add test case for issue #1111
juicejitsu [Wed, 10 Aug 2016 01:21:04 +0000 (18:21 -0700)]
Don't emit filename in diff mode, add filename to diff metadata
Stuart Dootson [Tue, 9 Aug 2016 20:11:27 +0000 (22:11 +0200)]
Add commentary
Stuart Dootson [Tue, 9 Aug 2016 20:10:48 +0000 (22:10 +0200)]
Reformat the source to actually pass the tests!
Stuart Dootson [Mon, 8 Aug 2016 21:13:45 +0000 (23:13 +0200)]
Add test case for issue #1111, by adding another route by which a test file's config can be located
Nick Cameron [Fri, 5 Aug 2016 06:03:34 +0000 (18:03 +1200)]
Merge pull request #1119 from HighCommander4/issue1109b
Apply space_before_type_annotation to struct ctors (#1109)
Nathan Ridge [Thu, 4 Aug 2016 04:17:47 +0000 (00:17 -0400)]
Apply space_before_type_annotation to struct ctors (#1109)
Nick Cameron [Fri, 5 Aug 2016 04:29:41 +0000 (16:29 +1200)]
Merge pull request #1117 from pepyakin/issue-1116
Fix underflow in format_imports
Sergey Pepyakin [Tue, 2 Aug 2016 22:25:54 +0000 (01:25 +0300)]
Fix issue-1116
Nick Cameron [Wed, 3 Aug 2016 22:58:32 +0000 (10:58 +1200)]
Merge pull request #1110 from HighCommander4/issue1109a
Add two new whitespace options (#1109)
Nick Cameron [Wed, 3 Aug 2016 22:11:24 +0000 (10:11 +1200)]
Merge pull request #1118 from julienXX/change-multirust-to-rustup-in-readme
Update README with Rustup.rs instead of multirust
Julien Blanchard [Wed, 3 Aug 2016 09:49:09 +0000 (11:49 +0200)]
Update README with Rustup.rs instead of multirust
Nathan Ridge [Wed, 3 Aug 2016 01:07:56 +0000 (21:07 -0400)]
Add two new whitespace options (#1109)
* An option to leave a space before the colon in a type annotation
* An option to leave a space before the colon in a trait or lifetime bound
Nick Cameron [Mon, 1 Aug 2016 21:25:25 +0000 (09:25 +1200)]
Merge pull request #1052 from julienXX/fix-imports-with-absolute-paths
Fix imports with absolute paths
Julien Blanchard [Wed, 8 Jun 2016 11:00:11 +0000 (13:00 +0200)]
Fix imports with absolute paths
dawirstejeck [Mon, 1 Aug 2016 04:25:00 +0000 (06:25 +0200)]
Fix overlong function signature (#1089)
* Fix issue-1049
* Add testcase suggested by pepyakin
* Fix last commit
* Handle special case
* Remove debugging println
* Fix grammar in comment
* Change word in comment
* Add test for long func without ret type
* Add one more test
Daniel Campoverde [Sun, 31 Jul 2016 21:32:35 +0000 (16:32 -0500)]
Multiple config file names feature (#1101)
* Add multiple configuration file names feature
* Add '.rustfmt.toml' in README file
* Clean up configuration file code
* Make config file names constant
* Use only one blank line
dawirstejeck [Tue, 26 Jul 2016 05:34:11 +0000 (07:34 +0200)]
Fix overlong impl (#1091)
* Fix issue-1048
* Take possible where-clause into account
* Move test to existing test set
* Fix wrong variable name
Stuart Dootson [Tue, 26 Jul 2016 05:20:01 +0000 (06:20 +0100)]
Add `use` declaration re-ordering (#1104)
* Add config options for combinations of lines and items
* Reordering of import lines implemented.
* Changed nested matches to tuple pattern matching
* Added ordering of path list items to the ordering of use declarations
* Move `format_imports` and `format_import` methods to `imports.rs`
* Add comment to explain how `use` declarations are split off while walking through a module
* Change `ImportReordering` config option to separate boolean options
Stuart Dootson [Mon, 18 Jul 2016 21:05:01 +0000 (22:05 +0100)]
Canonicalize file paths within the map of file line ranges (#1098)
* Canonicalize file paths within the map of file line ranges
* Forgot to run the tests - and of course, the formatting of the canonicalization change was off, but it's fixed now!
* Move imports to the top of the file, as per @nrc.
* Change `canonicalize_path_string` to return `Option<String>`, `None` indicating an error rather than an empty string
* `format!` is better than string concatenation...
* Change `canonicalize_path_string` to return `Result` rather than `Option`
Nick Cameron [Sun, 17 Jul 2016 20:04:23 +0000 (08:04 +1200)]
Merge pull request #1100 from studoot/add-appveyor-support
Add Appveyor CI support
Stuart Dootson [Fri, 15 Jul 2016 09:37:23 +0000 (10:37 +0100)]
Add appveyor CI support
Nick Cameron [Sun, 10 Jul 2016 22:24:53 +0000 (10:24 +1200)]
Merge pull request #1088 from sinkuu/issue_1086
Fix formatting empty block comments (`/**/`)
sinkuu [Sat, 9 Jul 2016 13:41:28 +0000 (22:41 +0900)]
Fix formatting empty block comments (`/**/`)
issue #1086
Nick Cameron [Mon, 4 Jul 2016 09:30:52 +0000 (21:30 +1200)]
Merge pull request #1084 from johannhof/rustfmt-not-found
Show more helpful error if rustfmt is not in PATH.
Johann Hofmann [Sat, 2 Jul 2016 20:19:04 +0000 (22:19 +0200)]
Show more helpful error if rustfmt is not in PATH.
This fixes #1071.
Nick Cameron [Mon, 4 Jul 2016 03:57:00 +0000 (15:57 +1200)]
Merge pull request #1083 from KaivoAnastetiks/fix/easy-issue-repo
Links to the rust-lang-nursery/rustfmt issue list.
Nick Cameron [Mon, 4 Jul 2016 03:46:58 +0000 (15:46 +1200)]
rustup
Kaivo Anastetiks [Sat, 2 Jul 2016 15:34:48 +0000 (11:34 -0400)]
Links to the rust-lang-nursery/rustfmt issue list.
Nick Cameron [Wed, 22 Jun 2016 22:24:19 +0000 (10:24 +1200)]
Merge pull request #1075 from johannhof/diff-exit
Return failure exit code on found diffs (fix #906)
Johann Hofmann [Mon, 20 Jun 2016 18:42:29 +0000 (20:42 +0200)]
Return failure exit code on found diffs (fix #906)
This changes rustfmt to return exit code 4
when run with write mode diff and differences between
the formatted code and the original code are found.
Useful for CI to make sure your contributors actually ran rustfmt.
Nick Cameron [Thu, 16 Jun 2016 08:35:00 +0000 (10:35 +0200)]
Merge pull request #1064 from dato/patch-2
Fix typo in path: ~/cargo/bin → ~/.cargo/bin
Dato Simó [Wed, 15 Jun 2016 03:48:58 +0000 (00:48 -0300)]
Fix typo in path: ~/cargo/bin → ~/.cargo/bin
Nick Cameron [Tue, 14 Jun 2016 06:32:02 +0000 (08:32 +0200)]
Merge pull request #1054 from sanxiyn/loop-width
Fix width computation in Loop::rewrite
Seo Sanghyeon [Wed, 8 Jun 2016 15:43:08 +0000 (00:43 +0900)]
Fix width computation in Loop::rewrite
Kamal Marhubi [Sun, 12 Jun 2016 08:38:03 +0000 (10:38 +0200)]
Include git commit and worktree status in version output (#1060)
This will help in debugging issues as rustfmt gets more users.
If the working tree is clean, output looks like
$ target/debug/rustfmt -V
0.5.0 (
9f5ed3b )
If the working tree is dirty, output looks like
$ target/debug/rustfmt -V
0.5.0 (
9f5ed3b worktree dirty)
If git is unavailable, output looks like
$ target/debug/rustfmt -V
0.5.0 (git commit unavailable)
To avoid rebuilds on changing tests, the build script will only rerun if
files under src/ are changed. This means the actual git status may show
changed files and this would not show up in the version. This should not
be an issue as files not in src/ should not affect the build output.
Nick Cameron [Fri, 10 Jun 2016 15:23:40 +0000 (17:23 +0200)]
Merge pull request #1061 from marcusklaas/fix-subtract2
Fix integer underflow in extra_offset
Marcus Klaas [Fri, 10 Jun 2016 14:16:14 +0000 (16:16 +0200)]
Fix integer underflow in extra_offset
Nick Cameron [Fri, 10 Jun 2016 14:00:46 +0000 (16:00 +0200)]
Merge pull request #1059 from marcusklaas/fix-subtract
Fix integer underflow
Marcus Klaas [Fri, 10 Jun 2016 13:09:27 +0000 (15:09 +0200)]
Fix integer underflow
Marcus Klaas de Vries [Tue, 7 Jun 2016 18:21:54 +0000 (20:21 +0200)]
Merge pull request #1042 from imjacobclark/1014-refactoring-vector-string-to-join
Refactor string collects to itertools join
Jacob Clark [Mon, 6 Jun 2016 23:03:25 +0000 (00:03 +0100)]
Refactoring exsisting filter_maps to maps
Jacob Clark [Mon, 6 Jun 2016 21:30:40 +0000 (22:30 +0100)]
Refactor string collects to itertools join
Nick Cameron [Sun, 5 Jun 2016 17:06:08 +0000 (18:06 +0100)]
Merge pull request #1033 from marcusklaas/assignment-break
Add test for general assignment breaks
Nick Cameron [Sun, 5 Jun 2016 17:05:19 +0000 (18:05 +0100)]
Merge pull request #1032 from marcusklaas/else-if-let-overflow
Fix constraints on pattern formatting of else arms
Marcus Klaas [Sat, 4 Jun 2016 09:00:01 +0000 (11:00 +0200)]
Add test for general assignment breaks
Marcus Klaas [Fri, 3 Jun 2016 21:18:19 +0000 (23:18 +0200)]
Fix constraints on pattern formatting of else arms
Nick Cameron [Fri, 3 Jun 2016 09:06:56 +0000 (10:06 +0100)]
Merge pull request #1030 from nokaa/master
Update Vim integration instructions
nokaa [Fri, 3 Jun 2016 07:52:48 +0000 (02:52 -0500)]
Update Vim integration instructions
Nick Cameron [Wed, 1 Jun 2016 11:28:36 +0000 (12:28 +0100)]
Merge pull request #1016 from rust-lang-nursery/try-double-indent
Treat chains with just expr? specially.
lqd [Tue, 31 May 2016 17:48:49 +0000 (19:48 +0200)]
Add support for the `default` keyword (#1025)
Adds support for Defaultness on impl methods.
Fixes #945
Nick Cameron [Tue, 31 May 2016 14:27:11 +0000 (15:27 +0100)]
Merge pull request #1023 from kamalmarhubi/diff-color-fix
print_diff: Don't print color codes if output is not a tty
Kamal Marhubi [Tue, 31 May 2016 13:15:33 +0000 (15:15 +0200)]
print_diff: Don't print color codes if output is not a tty
On unix, `term::stdout()` just reads the `TERM` environment variable to
decide what features are available. It does not check if the output file
descriptor is in fact a tty. This resulted in printing escape codes when
redirecting output.
Nick Cameron [Tue, 31 May 2016 07:45:45 +0000 (08:45 +0100)]
Merge pull request #1007 from kamalmarhubi/basic-line-ranges-v2
Add infrastructure for formatting specific line ranges
Kamal Marhubi [Mon, 30 May 2016 22:42:14 +0000 (00:42 +0200)]
README: Explain that --file-lines ranges are 1-based
Kamal Marhubi [Mon, 30 May 2016 14:41:43 +0000 (16:41 +0200)]
Explain that FileLines cannot be given in rustfmt.toml
This adds a note to both the `--config-help` output for `file_lines`,
and to the panic message on attempting to deserialize a `FileLines`
struct.
Kamal Marhubi [Mon, 30 May 2016 14:10:26 +0000 (16:10 +0200)]
codemap: Add module description
Kamal Marhubi [Mon, 30 May 2016 14:10:12 +0000 (16:10 +0200)]
Add copyright notices to added files
Kamal Marhubi [Sun, 10 Apr 2016 17:03:54 +0000 (13:03 -0400)]
rustfmt: Add option to specify line ranges for formatting
This commit adds the `--experimental-file-lines` option to rustfmt. This
allows specifying line ranges to format from the command line.
Refs #434
Kamal Marhubi [Sat, 12 Mar 2016 00:19:16 +0000 (19:19 -0500)]
visitor: Handle specified line ranges in visit_stmt
This commit adds a very rough implementation of handling the specified
line ranges in `config.file_lines_map` for statements. It reformats a
statement if its span is fully contained in the set of lines specified
for the file.
The implementation here is intended as a proof of concept, and
demonstration that the machinery added in the preceding commits is
functional. A final implementation would likely hook in via the
`Rewrite` trait.
Refs #434
Kamal Marhubi [Thu, 26 May 2016 12:17:20 +0000 (14:17 +0200)]
Add type to represent collection of lines in files
This commit adds a type to represent lines in files, and adds it to the
`Config` struct. It will be used for restricting formatting to specific
lines.
Refs #434
Kamal Marhubi [Thu, 26 May 2016 11:49:19 +0000 (13:49 +0200)]
codemap: Add utilities for looking up line ranges of spans
This commit adds extension methods to `Codemap` to allow looking up line
ranges for spans.
Refs #434
Kamal Marhubi [Wed, 25 May 2016 18:41:26 +0000 (20:41 +0200)]
utils: Move codemap related utilities to a dedicated module
This commit adds a `codemap` module, and moves the `CodemapSpanUtils`
added in #857 to it. This is preparation for adding more `Codemap`
specific utilities.
Refs #434
Kamal Marhubi [Wed, 25 May 2016 18:41:26 +0000 (20:41 +0200)]
visitor: Add debug log for FmtVisitor::visit_stmt()
Kamal Marhubi [Wed, 25 May 2016 18:41:26 +0000 (20:41 +0200)]
Derive Debug for the Input enum
Nick Cameron [Mon, 30 May 2016 13:57:29 +0000 (01:57 +1200)]
Merge pull request #1017 from marcusklaas/tweak-if-else
Format non-statement if-else expressions on a single line
Nick Cameron [Mon, 30 May 2016 13:25:09 +0000 (01:25 +1200)]
Merge pull request #1022 from kamalmarhubi/update-syntex-syntax
deps: Update syntex_syntax to 0.33
Nick Cameron [Mon, 30 May 2016 13:24:07 +0000 (01:24 +1200)]
Merge pull request #1015 from srinivasreddy/readme
Add section - Installing from source
Kamal Marhubi [Mon, 30 May 2016 12:53:04 +0000 (14:53 +0200)]
deps: Update syntex_syntax to 0.33
This bump brings syntex_syntax support for `..` in tuple and tuple
struct patterns, which come from RFC 1492:
https://github.com/rust-lang/rfcs/blob/master/text/1492-dotdot-in-patterns.md
These new patterns are not properly handled in this PR; instead #1021
tracks supporting them.
Refs #1021
Marcus Klaas [Sun, 29 May 2016 15:58:38 +0000 (17:58 +0200)]
Format non-statement if-else expressions on a single line
Nick Cameron [Sat, 28 May 2016 20:50:25 +0000 (21:50 +0100)]
Treat chains with just expr? specially.
Fixes #1004
Srinivas Reddy Thatiparthy [Sat, 28 May 2016 15:38:33 +0000 (21:08 +0530)]
Add section - Installing from source
Kamal Marhubi [Fri, 27 May 2016 22:58:25 +0000 (00:58 +0200)]
Handle pub(restricted) (#1013)
* Handle pub(restricted)
This commit properly handles pub(restricted) as introduced in RFC 1422
[0]. The syntax support was added in #971, but they were not correctly
formatted.
[0] https://github.com/rust-lang/rfcs/blob/master/text/1422-pub-restricted.md
Fixes #970
* Drop #[inline] attribute on format_visibility
* Make newly non-failing functions return String
The change to `format_visibiilty` means that `format_header` and
`format_unit_struct` can no longer fail. Their return type is updated to
reflect that.
Nick Cameron [Fri, 27 May 2016 22:08:00 +0000 (10:08 +1200)]
Merge pull request #1008 from rust-lang-nursery/hrtb
Don't ignore universal quantification in function types
Nick Cameron [Thu, 26 May 2016 22:39:28 +0000 (10:39 +1200)]
Don't ignore universal quantification in function types
Fixes #1006
Nick Cameron [Fri, 27 May 2016 22:04:04 +0000 (10:04 +1200)]
Merge pull request #1009 from rust-lang-nursery/fn-args-1
Fix off by 2 error in function sigs
Nick Cameron [Thu, 26 May 2016 23:49:26 +0000 (11:49 +1200)]
Fix off by 2 error in function sigs
Fixes #1000
This is a little conservative in some cases, but better than being wrong in others.
Nick Cameron [Fri, 27 May 2016 08:33:19 +0000 (20:33 +1200)]
Don't put a newline before `?` when it is the second sub-expression in a chain (#1012)
Fixes #1003
Nick Cameron [Wed, 18 May 2016 20:38:49 +0000 (08:38 +1200)]
Optionally put short struct variants on one line (#997)
Closes #418
Nick Cameron [Wed, 18 May 2016 20:36:59 +0000 (08:36 +1200)]
Format inline attributes on out-of-line modules (#996)
Fixes #838