Commit Graph

1818 Commits

Author SHA1 Message Date
topecongiro
1d8619d49a Fix wrong indentation on type alias
Use rewrite_assign_rhs() when rewriting type alias.
2017-12-21 09:58:13 +09:00
Seiichi Uchida
ccc487ade7 Do not put comment's line start and closer on the same line 2017-12-17 15:25:24 +09:00
Seiichi Uchida
81eb88c4c0 Respect leading whitespace in original comment when wrapping comment 2017-12-17 15:24:49 +09:00
topecongiro
3a98b5a5be Format trait aliases 2017-12-15 13:47:52 +09:00
topecongiro
d60c2ec5d3 Add an initial support for trait aliases 2017-12-15 10:35:07 +09:00
Oliver Schneider
fad903fd14 Move from String to PathBuf where applicable 2017-12-15 10:26:19 +09:00
Nick Cameron
4ee7911f4b
Merge pull request #2271 from topecongiro/refactorings
Refactorings from cargo clippy etc.
2017-12-15 08:53:48 +13:00
Seiichi Uchida
7229b26f14 Do not print to stderr when parsing the toml file succeeded 2017-12-12 14:10:31 +09:00
Seiichi Uchida
efb68ee21a Refactor write_snippet_inner() 2017-12-12 13:48:24 +09:00
Seiichi Uchida
516f15aba1 Cargo clippy 2017-12-12 13:48:12 +09:00
topecongiro
17154c30cb Warn when there are unknown config options 2017-12-12 00:54:55 +09:00
topecongiro
32804c1f09 Do not print usage when rustfmt failed 2017-12-12 00:54:37 +09:00
Nick Cameron
fc52a4d33f
Merge pull request #2173 from topecongiro/assignment-with-100-chars
Assignment whose lhs has 100 chars
2017-12-11 17:04:41 +13:00
Nick Cameron
644b60ad85
Merge pull request #2257 from topecongiro/error-on-line-overflow-strings
Add error_on_line_overflow_strings config option
2017-12-11 16:41:15 +13:00
Nick Cameron
3c08da3433
Merge pull request #2270 from topecongiro/issue-2260
Trim a trailing whitespace on empty line inside code block comment
2017-12-11 16:40:12 +13:00
Seiichi Uchida
3dd31e25bf Use enumerate() 2017-12-11 11:50:11 +09:00
Seiichi Uchida
e45c0c4815 Rename error_on_unformatted_comments_or_strings to error_on_unformatted 2017-12-11 11:48:17 +09:00
Seiichi Uchida
d3ee7f3f06 Set error_on_unformatted_comments_or_strings to true when --error-on-unformatted
option is passed
2017-12-11 11:48:17 +09:00
Seiichi Uchida
93a75de18e Print command line options in alphabetical order 2017-12-11 11:48:17 +09:00
Seiichi Uchida
1e982c66a0 Fix a typo 2017-12-11 11:48:17 +09:00
Seiichi Uchida
cbd3608c30 Organize command line options and start with upper case 2017-12-11 11:48:17 +09:00
Seiichi Uchida
d17168f4ba Add error-on-unformatted command line option 2017-12-11 11:48:17 +09:00
Seiichi Uchida
aea19d5e33 Combine error_on_line_overflow_comments/strings
1. Rename to error_on_unformatted_comments_or_strings
2. Set the option to false by default.
2017-12-11 11:48:17 +09:00
Seiichi Uchida
4d9226ffee Fix a typo 2017-12-11 11:48:17 +09:00
Seiichi Uchida
6c3de706ae Make RichChar public 2017-12-11 11:48:17 +09:00
Seiichi Uchida
ef6ebaa215 Add a config option to suppress error message on string literal 2017-12-11 11:48:17 +09:00
Seiichi Uchida
d1e5d7866b Make CharClasses and FullCodeCharKind public 2017-12-11 11:47:19 +09:00
Seiichi Uchida
5faf31bb32 Trim a trailing whitespace on empty line inside code block comment 2017-12-11 11:37:13 +09:00
Seiichi Uchida
db29f9e0f7 Fix indent issue when recovering comments
Closes #1989
2017-12-11 09:20:02 +09:00
Seiichi Uchida
414a995926 Replace StringBuffer with String 2017-12-11 09:19:00 +09:00
Nick Cameron
0c9b2b402e
Merge pull request #2267 from topecongiro/issue-2264
Remove block() and block_only() wherever possible
2017-12-11 09:02:16 +13:00
Nick Cameron
08022ec1a3
Merge pull request #2265 from topecongiro/issue-2262
Fix bugs related to closures
2017-12-11 09:00:56 +13:00
Nick Cameron
5da2d7be32
Merge pull request #2258 from topecongiro/issue-819
Format macro in pattern position
2017-12-11 08:54:02 +13:00
Nick Cameron
d2b006d6b4
Merge pull request #2255 from topecongiro/nested-imports
Nested imports
2017-12-11 08:53:23 +13:00
Nick Cameron
68b43b2240
Merge pull request #2250 from topecongiro/rustfmt-skip-no-warning-on-items
Do not report errors on skipped items or statements
2017-12-11 08:47:26 +13:00
Seiichi Uchida
b29a3afb96 Fix indentation in multi lined pattern 2017-12-10 23:54:34 +09:00
Seiichi Uchida
a7060f9fdf Remove excessive block() and block_only()
Since we now use the same indent style for every expressions, these safe guards
can be removed.
2017-12-10 23:39:09 +09:00
Seiichi Uchida
e3d2f2c2b1 Cargo fmt 2017-12-10 21:54:26 +09:00
Seiichi Uchida
90383d7426 Do not set inside_macro flag when converting try!() to '?'
This will keep rustfmt idempotent when using 'use_try_shorthand' config option.
2017-12-10 21:53:01 +09:00
Seiichi Uchida
42726906f7 Allow struct to be multi-lined in closure's body without block 2017-12-10 21:52:23 +09:00
Seiichi Uchida
bd6bef8cfa Move macro check to is_block_closure_forced() 2017-12-10 21:49:59 +09:00
Seiichi Uchida
812fc4ca56 Remove and_one_line() 2017-12-10 21:30:12 +09:00
Seiichi Uchida
5871967312 Verify whether adding block is safe in rewrite_closure_with_block()
Also ensure that the expression is nested to avoid false-positive.
2017-12-10 21:27:28 +09:00
Christopher Durham
7e2c3cb857 unstable_features without CFG_RELEASE_CHANNEL
Per discussion in #2228

https://github.com/rust-lang-nursery/rustfmt/pull/2228#issuecomment-348893294
https://github.com/rust-lang-nursery/rustfmt/pull/2228#issuecomment-349799548

Inline comment should explain the reasoning.
2017-12-10 01:01:36 -05:00
Seiichi Uchida
5624175574 Format macro in pattern position 2017-12-10 00:22:00 +09:00
Seiichi Uchida
234c7da871 Handle nested imports 2017-12-09 16:45:25 +09:00
topecongiro
adc3b12ad4 Remove println! debug :( 2017-12-08 17:48:49 +09:00
topecongiro
821d04b2a4 Do not report errors on skipped items or statements 2017-12-08 17:46:43 +09:00
topecongiro
5e6bb3edb0 Keep track of line number in visitor 2017-12-08 16:59:04 +09:00
Nick Cameron
97fd517593
Merge pull request #2247 from topecongiro/optimize-snippet
Optimize snippet()
2017-12-08 20:39:01 +13:00