Commit graph

4139 commits

Author SHA1 Message Date
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
Nick Cameron
a67208f212
Merge pull request #2986 from topecongiro/issue-2907
Handle chain w/ try operators with spaces
2018-09-03 13:10:50 +12:00
Nick Cameron
5fb9418aec
Merge pull request #2991 from topecongiro/raw-identifier-in-chain
Handle raw identifiers in chain
2018-09-03 13:08:19 +12:00
Maximilian Roos
968affc3e0
final clippy changes 2018-09-01 16:32:38 -04:00
Seiichi Uchida
08e282877a Handle raw identifiers in chain 2018-09-01 16:18:27 +09:00
Seiichi Uchida
627780864f
Merge pull request #2987 from YaLTeR/fix-issue-2930
Use correct shape in Visual tuple rewriting
2018-09-01 16:04:14 +09:00
Ivan Molodetskikh
54f8bcb5a2
Use correct fn args indent for Visual 2018-08-31 16:53:18 +03:00
Ivan Molodetskikh
05b6aaa130
Add debug logging to fn-related functions 2018-08-31 16:52:45 +03:00
Ivan Molodetskikh
430f848c75
Add a test for #2922 2018-08-31 16:25:01 +03:00
Ivan Molodetskikh
6a029974de
Fix shape in rewrite_tuple_in_visual_indent_style 2018-08-31 15:50:41 +03:00
Ivan Molodetskikh
098a5391f0
Add a test for #2930 2018-08-31 15:25:08 +03:00
Seiichi Uchida
ec6086b802
Merge pull request #2984 from mehcode/feature/edition-option
Accept 2015 and 2018 instead of Edition2015 and Edition2018 for edition option
2018-08-31 18:26:19 +09:00
Seiichi Uchida
ba9e159722 Update tests 2018-08-31 18:20:28 +09:00
Seiichi Uchida
20aac086d6 Simplify post-comment extraction 2018-08-31 18:20:28 +09:00