Commit Graph

1678 Commits

Author SHA1 Message Date
Nick Cameron
9ed9618f1c Merge pull request #1122 from studoot/add-test-for-1111
Add test case for issue #1111
2016-08-10 18:12:16 +12:00
juicejitsu
a0de408198 Don't emit filename in diff mode, add filename to diff metadata 2016-08-09 18:21:04 -07:00
Stuart Dootson
5dda986a2c Add commentary 2016-08-09 22:11:27 +02:00
Stuart Dootson
4055e272da Reformat the source to actually pass the tests! 2016-08-09 22:10:48 +02:00
Stuart Dootson
cb0b7108ca Add test case for issue #1111, by adding another route by which a test file's config can be located 2016-08-08 23:13:45 +02:00
Nick Cameron
69f647b9f1 Merge pull request #1119 from HighCommander4/issue1109b
Apply space_before_type_annotation to struct ctors (#1109)
2016-08-05 18:03:34 +12:00
Nathan Ridge
899169a1d2 Apply space_before_type_annotation to struct ctors (#1109) 2016-08-05 01:30:53 -04:00
Nick Cameron
f21808a65c Merge pull request #1117 from pepyakin/issue-1116
Fix underflow in format_imports
2016-08-05 16:29:41 +12:00
Sergey Pepyakin
f6959a4772 Fix issue-1116 2016-08-04 08:54:40 +03:00
Nick Cameron
fe69e975e3 Merge pull request #1110 from HighCommander4/issue1109a
Add two new whitespace options (#1109)
2016-08-04 10:58:32 +12:00
Nick Cameron
9ea53d617d Merge pull request #1118 from julienXX/change-multirust-to-rustup-in-readme
Update README with Rustup.rs instead of multirust
2016-08-04 10:11:24 +12:00
Julien Blanchard
fb1493055b Update README with Rustup.rs instead of multirust 2016-08-03 11:49:09 +02:00
Nathan Ridge
4b999a99c0 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
2016-08-03 01:11:39 -04:00
Nick Cameron
b57ea4e39a Merge pull request #1052 from julienXX/fix-imports-with-absolute-paths
Fix imports with absolute paths
2016-08-02 09:25:25 +12:00
Julien Blanchard
b4e49ddbf5 Fix imports with absolute paths 2016-08-01 10:10:04 +02:00
dawirstejeck
22de7ced28 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
2016-08-01 16:25:00 +12:00
Daniel Campoverde
6380937b59 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
2016-08-01 09:32:35 +12:00
dawirstejeck
e76cb6a907 Fix overlong impl (#1091)
* Fix issue-1048

* Take possible where-clause into account

* Move test to existing test set

* Fix wrong variable name
2016-07-26 17:34:11 +12:00
Stuart Dootson
78b52ec3e1 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
2016-07-26 17:20:01 +12:00
Stuart Dootson
9750fb7fca 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`
2016-07-19 09:05:01 +12:00
Nick Cameron
25f973224c Merge pull request #1100 from studoot/add-appveyor-support
Add Appveyor CI support
2016-07-18 08:04:23 +12:00
Stuart Dootson
c917462a92 Add appveyor CI support 2016-07-15 11:17:15 +01:00
Nick Cameron
ca2debdcb1 Merge pull request #1088 from sinkuu/issue_1086
Fix formatting empty block comments (`/**/`)
2016-07-11 10:24:53 +12:00
sinkuu
0dc3fc7a2c Fix formatting empty block comments (/**/)
issue #1086
2016-07-09 22:56:50 +09:00
Nick Cameron
ffa5a22d1c Merge pull request #1084 from johannhof/rustfmt-not-found
Show more helpful error if rustfmt is not in PATH.
2016-07-04 21:30:52 +12:00
Johann Hofmann
033741246c
Show more helpful error if rustfmt is not in PATH.
This fixes #1071.
2016-07-04 07:42:18 +02:00
Nick Cameron
b51bcbfbef Merge pull request #1083 from KaivoAnastetiks/fix/easy-issue-repo
Links to the rust-lang-nursery/rustfmt issue list.
2016-07-04 15:57:00 +12:00
Nick Cameron
ddda46d265 rustup 2016-07-04 15:46:58 +12:00
Kaivo Anastetiks
a9d27f92ce Links to the rust-lang-nursery/rustfmt issue list. 2016-07-02 11:34:48 -04:00
Nick Cameron
7c70254fd8 Merge pull request #1075 from johannhof/diff-exit
Return failure exit code on found diffs (fix #906)
2016-06-23 10:24:19 +12:00
Johann Hofmann
8260d277c8
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.
2016-06-21 23:01:15 +02:00
Nick Cameron
48a37713f9 Merge pull request #1064 from dato/patch-2
Fix typo in path: ~/cargo/bin → ~/.cargo/bin
2016-06-16 10:35:00 +02:00
Dato Simó
7c5efd7437 Fix typo in path: ~/cargo/bin → ~/.cargo/bin 2016-06-15 00:48:58 -03:00
Nick Cameron
664bf3eae7 Merge pull request #1054 from sanxiyn/loop-width
Fix width computation in Loop::rewrite
2016-06-14 08:32:02 +02:00
Seo Sanghyeon
921b563847 Fix width computation in Loop::rewrite 2016-06-12 20:37:15 +09:00
Kamal Marhubi
5361f61110 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.
2016-06-12 10:38:03 +02:00
Nick Cameron
1743f5caf6 Merge pull request #1061 from marcusklaas/fix-subtract2
Fix integer underflow in extra_offset
2016-06-10 17:23:40 +02:00
Marcus Klaas
88fdf9a6e3 Fix integer underflow in extra_offset 2016-06-10 16:17:10 +02:00
Nick Cameron
931e71eb43 Merge pull request #1059 from marcusklaas/fix-subtract
Fix integer underflow
2016-06-10 16:00:46 +02:00
Marcus Klaas
1b55aa9f10 Fix integer underflow 2016-06-10 15:19:06 +02:00
Marcus Klaas de Vries
c31a366f0b Merge pull request #1042 from imjacobclark/1014-refactoring-vector-string-to-join
Refactor string collects to itertools join
2016-06-07 20:21:54 +02:00
Jacob Clark
77edbb7def
Refactoring exsisting filter_maps to maps 2016-06-07 00:03:25 +01:00
Jacob Clark
2ea99869a7
Refactor string collects to itertools join 2016-06-06 22:30:40 +01:00
Nick Cameron
3d4bc8c84a Merge pull request #1033 from marcusklaas/assignment-break
Add test for general assignment breaks
2016-06-05 18:06:08 +01:00
Nick Cameron
e7294285f0 Merge pull request #1032 from marcusklaas/else-if-let-overflow
Fix constraints on pattern formatting of else arms
2016-06-05 18:05:19 +01:00
Marcus Klaas
05188deadc Add test for general assignment breaks 2016-06-04 11:00:01 +02:00
Marcus Klaas
b3488c6186 Fix constraints on pattern formatting of else arms 2016-06-03 23:18:19 +02:00
Nick Cameron
728eb0005f Merge pull request #1030 from nokaa/master
Update Vim integration instructions
2016-06-03 10:06:56 +01:00
nokaa
af4a9fa6f6
Update Vim integration instructions 2016-06-03 02:52:48 -05:00
Nick Cameron
0087306761 Merge pull request #1016 from rust-lang-nursery/try-double-indent
Treat chains with just expr? specially.
2016-06-01 12:28:36 +01:00