Commit Graph

3952 Commits

Author SHA1 Message Date
Seiichi Uchida
594774b4e5 Update tests 2018-09-19 23:19:24 +09:00
Nick Cameron
829dbfabe9
Merge pull request #3028 from scampi/issue2973
Fix indent computation of a macro with braces.
2018-09-19 11:31:28 +12:00
Nick Cameron
1739041f03
Merge pull request #3002 from lqd/normalize-doc-attributes
normalize_doc_attributes option: convert doc attributes to comments
2018-09-19 11:05:27 +12:00
Nick Cameron
2267c2cddc
Merge pull request #3001 from scampi/issue2977
propagate errors about failing to rewrite a macro
2018-09-19 10:43:21 +12:00
Nick Cameron
14fdf2e6b1
Merge pull request #3014 from PSeitz/master
fixes #2914 by handling BadIssue case
2018-09-19 10:42:16 +12:00
Seiichi Uchida
661bea71c1
Merge pull request #3013 from YaLTeR/fix-issue-2985
Fix wrong shape for last chain items for indent_style = "Visual"
2018-09-18 20:21:21 +09:00
Nathan Sutton
d165533813 Improve error message when failing cargo metadata (#3024) 2018-09-18 20:20:07 +09:00
Seiichi Uchida
68ede7bf45
Merge pull request #3019 from yangby-cryptape/fix-typo-in-readme
Fix typo in README.md.
2018-09-18 20:18:24 +09:00
Seiichi Uchida
abe1e60a73
Merge pull request #3017 from matthiaskrgr/typo
cargo fmt: fix typo in format_crate(): (verison -> version)
2018-09-18 20:17:59 +09:00
Nick Cameron
01c14a2058
Merge pull request #3012 from YaLTeR/fix-issue-2496
Fix match arm block flattening
2018-09-18 21:12:12 +12:00
Stéphane Campinas
c3edf6d3a1
Fix indent computation of a macro with braces.
The leading whitespace of a multine string was taken into account when
computing the `min_prefix_space_width`, even if that line couldn't be
trimmed. The consequence is it was always shifting the macro's content
to the right.
2018-09-18 00:01:51 +02:00
Boyu Yang
ef4de4d005
Fix typo in README.md. 2018-09-13 10:01:34 +08:00
Rémy Rakic
0c73b9414b add test ensuring only doc = "" attributes are normalized to comments
The other shapes of doc attributes shouldn't be normalized or modified.
2018-09-13 02:40:24 +02:00
Rémy Rakic
cbc58410d9 add tests interleaving doc attrib comments and regular comments 2018-09-13 02:27:09 +02:00
Rémy Rakic
6c96ab7c9a address review comment in Attribute rewrite fn 2018-09-13 01:13:07 +02:00
Rémy Rakic
171e656f64 add non-regression test to existing attributes
when `normalize_doc_attributes` is on, they shouldn't be affected
2018-09-13 01:10:57 +02:00
Rémy Rakic
4af0888648 add non-regression test to existing doc attributes
when `normalize_doc_attributes` is off, they shouldn't be normalized to a doc comment
2018-09-13 01:06:02 +02:00
Rémy Rakic
43f813867c add test with multiple levels of indents 2018-09-13 01:02:11 +02:00
Rémy Rakic
9f6cf7b72c move config attribute 2018-09-13 00:37:31 +02:00
Matthias Krüger
5947ea607c cargo fmt: fix typo in format_crate(): (verison -> version) 2018-09-12 21:43:31 +02:00
Stéphane Campinas
1befc93ba0
implement Drop from FmtVisitor in order to simplify failures passing 2018-09-12 13:09:07 +02:00
Nick Cameron
81a4235c7f
Merge pull request #3000 from dimbleby/dch/typo
Fix typo in usage text
2018-09-12 15:33:18 +12:00
Nick Cameron
f5f64b3b4a
Merge pull request #2998 from ReapOmen/fix-rustfmt-diff-output
Change `print_diff` to output the correct line number.
2018-09-12 15:32:27 +12:00
Nick Cameron
e39bd35ae1
Merge pull request #3010 from topecongiro/issue-3009
Refactor the corner case of handling long function
2018-09-12 13:55:41 +12:00
Nick Cameron
bba7dbf2d7
Merge pull request #3011 from topecongiro/rustc-ap-syntax
Cargo update
2018-09-12 13:55:06 +12:00
Nick Cameron
58188dbe1b
Merge pull request #3015 from YaLTeR/fix-fn-type-comma
Fix extra new line in fn type aliases with indent_style = "Visual"
2018-09-12 13:54:23 +12:00
Ivan Molodetskikh
11435c5954
Don't insert a new line when fn has no return type 2018-09-11 12:34:33 +03:00
Ivan Molodetskikh
2f03a31e1a
Add a visual fn type alias test 2018-09-11 12:34:21 +03:00
Pascal Seitz
60c414c857 fixes #2914 by handling BadIssue case 2018-09-11 10:46:39 +02:00
Ivan Molodetskikh
4b4fb557d7
Fix last chain item shape for Visual indent_style 2018-09-11 11:09:31 +03:00
Ivan Molodetskikh
abcdc0fadd
Add a test for #2985 2018-09-11 11:09:31 +03:00
Ivan Molodetskikh
838df8dfb6
Use correct heuristic for match block flattening 2018-09-11 08:54:43 +03:00
Ivan Molodetskikh
f116baeed7
Add a test for match flattening 2018-09-11 08:54:43 +03:00
Ivan Molodetskikh
bc03234e25
Add a test for #2496 2018-09-11 08:54:43 +03:00
Seiichi Uchida
e06f16a0a5 Cargo update 2018-09-11 13:52:46 +09:00
Seiichi Uchida
d8357484ac Refactor the corner case of handling long function 2018-09-11 13:31:37 +09:00
Seiichi Uchida
9674e12a5c Add a test for #3009 2018-09-11 13:30:36 +09:00
Nick Cameron
77824a24ef
Merge pull request #2988 from YaLTeR/fix-issue-2922
Use correct indent in rewrite_bare_fn with Visual style
2018-09-11 15:50:13 +12:00
Nick Cameron
29df2179b7
Merge pull request #3007 from alexcrichton/wasm
Support platforms without a timer
2018-09-10 09:50:49 +12:00
Alex Crichton
46e2a2e7c7 Support platforms without a timer
I've dabbled recently in seeing how hard it would be to compile rustfmt to wasm
and then run it in a web browser, and it turns out that it's [not too
hard][wasm]! In addition to patching a few dependencies which already have a
number of patches out rustfmt also needed some modifications to get it to work,
namely avoiding the usage of `Instant::now()` on the "happy path" which doesn't
work on wasm (it just panics).

This commit is an attempt to add a support for this by avoiding using
`Instant::now()` on the wasm target, but panicking if the actual time elapsed is
requested (which doesn't happen unless verbosely logging I believe).

[wasm]: https://alexcrichton.github.io/rustfmt-wasm/
2018-09-09 11:13:15 -07:00
lqd
4b7130dfa1 normalize_doc_attributes option: convert doc attributes to comments
Convert `#![doc]` and `#[doc]` attributes to `//!` and `///` doc comments.
2018-09-07 21:58:35 +02:00
Stéphane Campinas
6f318e3cef
propagate errors about failing to rewrite a macro 2018-09-07 14:48:52 +02:00
David Hotham
90ec5a226f Fix typo in usage text 2018-09-07 09:01:44 +01:00
Robert Bartlensky
992b179d33 Change print_diff to output the correct line number. 2018-09-06 17:18:33 +01:00
Nick Cameron
6ada5b51cc
Merge pull request #2997 from matthiaskrgr/cargo_test_release
fix cargo test --release
2018-09-06 17:40:08 +12:00
Matthias Krüger
e058a3f7e7 fix cargo test --release.
test::verify_check_works was failing in relase mode on my machine.

The problem was it would check for target/debug/rustfmt in release mode instead of
target/release/rustfmt and fail an assert.

This commit fixes it so that cargo check looks for target/debug/rustfmt and
cargo check --release looks for target/release/rustfmt
2018-09-06 02:07:09 +02:00
Nick Cameron
f655671e12
Merge pull request #2983 from topecongiro/issue-2642
Handle raw string literals in CharClasses
2018-09-04 19:11:49 +12:00
Nick Cameron
414f98e775
Merge pull request #2993 from topecongiro/rustc-ap
Cargo update
2018-09-04 19:11:23 +12:00
topecongiro
1704e24956 Cargo update 2018-09-04 00:17:26 +09:00
Nick Cameron
2291be7fa1
Merge pull request #2992 from max-sixty/clippy2
Clippy 2/2
2018-09-03 13:25:35 +12:00