Commit graph

2775 commits

Author SHA1 Message Date
Oliver Scherer
c60d6ddc02
"first" element check does nothing 2019-04-22 13:04:44 +02:00
Seiichi Uchida
5dd042c152
Merge pull request #3511 from topecongiro/issue3498
Avoid overflowing item with attributes
2019-04-17 11:40:00 -07:00
Seiichi Uchida
760ec07978
Merge pull request #3510 from topecongiro/issue3509
Fix duplication of attributes on a match arm's body
2019-04-17 11:39:44 -07:00
Ruben Schmidmeister
3dc625c661 Use annotate-snippets for emitting errors (#3507) 2019-04-17 05:33:36 -07:00
Seiichi Uchida
efa3a62b56
Merge pull request #3512 from scampi/issue-2724
exit integration test successfully if the crate build failed before applying rustfmt
2019-04-16 00:42:15 -07:00
Stéphane Campinas
d0df47fc58
Merge pull request #3506 from rchaser53/issue-3505
fix not to emit version
2019-04-16 07:29:26 +02:00
Stéphane Campinas
1c7202b2ee
fix test_ignore_path_set test when run on beta
```
---- ignore_path::test::test_ignore_path_set stdout ----
Warning: can't set `ignore = IgnoreList({"foo.rs", "bar_dir/*"})`, unstable features are only available in nightly channel.
thread 'ignore_path::test::test_ignore_path_set' panicked at 'assertion failed: ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/foo.rs")))', src/ignore_path.rs:51:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
failures:
    ignore_path::test::test_ignore_path_set
```
2019-04-15 14:00:11 +02:00
topecongiro
d3e578b131 Avoid overflowing item if it has attributes 2019-04-14 20:45:04 +09:00
rchaser53
15ab363508 not to use Vec 2019-04-14 20:37:29 +09:00
topecongiro
b57e0e2279 Disallow putting a body with attributes on the same line 2019-04-14 20:13:54 +09:00
topecongiro
3d80678e24 Do not include body's attributes in arrow_span 2019-04-14 20:13:07 +09:00
rChaser53
34bf13718a Allow specifying glob pattern to ignore config option (#3488) 2019-04-14 03:30:44 -07:00
rchaser53
3759a6695d add the error mapping 2019-04-14 17:34:53 +09:00
rchaser53
8a04ec6ec7 fix not to emit version 2019-04-14 00:23:10 +09:00
Matthias Krüger
4352681d62 fix clippy warnings
clippy::needless_return
clippy::redundant_closure
clippy::or_fun_call
clippy::len_zero
clippy::expect_fun_call
clippy::assertions_on_constants
clippy::identity_conversion
clippy::chars_last_cmp
2019-04-11 13:48:13 +02:00
Seiichi Uchida
378b28b06e
Merge pull request #3495 from scampi/issue-1096
keep missed comments appearing after the struct/enum ident
2019-04-10 06:00:51 +09:00
rchaser53
8ffe4146cc fix not to delete semicolon 2019-04-07 12:31:57 +09:00
Stéphane Campinas
bf383c4610
keep missed comments appearing after the struct/enum ident 2019-04-05 17:11:11 +02:00
Stéphane Campinas
8e068510a4 keep comment appearing between parameter's name and its type (#3491) 2019-04-03 18:16:54 +09:00
Christian Duerr
919bee8990
Enable overflow_delimited_expr for structs
This fixes https://github.com/rust-lang/rustfmt/issues/3482.
2019-03-30 18:37:37 +01:00
Seiichi Uchida
dfa94d1505
Merge pull request #3480 from sinkuu/cleanup
Cleanups
2019-03-29 22:07:19 +09:00
Seiichi Uchida
f70ce00305
Merge pull request #3479 from sinkuu/issue_2995
Fix indexing panic on unicode whitespaces
2019-03-29 22:03:42 +09:00
Shotaro Yamada
c0ff894a22 Fix indexing panic on unicode whitespaces 2019-03-29 20:12:45 +09:00
Shotaro Yamada
9fda937779 Remove redundant & 2019-03-29 19:17:50 +09:00
Shotaro Yamada
ff0683d666 Simplify iterators 2019-03-29 19:06:32 +09:00
Shotaro Yamada
8e4c20da80 Write seperator beforehand 2019-03-29 19:06:32 +09:00
Shotaro Yamada
6e288fdae0 Remove a write of empty string 2019-03-29 19:06:32 +09:00
Shotaro Yamada
a2d9b6d1b1 Remove redundant scopes 2019-03-29 19:06:32 +09:00
Shotaro Yamada
e3a4a03657 Use str::repeat 2019-03-29 19:06:32 +09:00
Seiichi Uchida
b4b80b6395
Merge pull request #3472 from devinalvaro/add-print-current-config
Add option to print current config to stdout
2019-03-29 17:35:02 +09:00
topecongiro
968d30f5d8 Run tests in a thread with larger stack size 2019-03-26 23:35:07 +09:00
Devin Alvaro
b473e65257 Add --print-config current 2019-03-26 06:49:20 +07:00
Stéphane Campinas
a373e73f5a
Merge pull request #3469 from topecongiro/cargo-fmt
Fix cargo fmt inconsistency
2019-03-25 12:33:25 +01:00
Seiichi Uchida
17ca7408f3 Do not add a space after empty impl 2019-03-25 11:21:14 +09:00
topecongiro
b4d4b5795e Use BTreeMap to guarantee consistent ordering 2019-03-25 07:54:52 +09:00
topecongiro
5f1f5aac05 Make sure that we run rustfmt against every edition 2019-03-25 07:54:31 +09:00
Seiichi Uchida
288d7db5a9
Merge pull request #3467 from topecongiro/issue-3465
Fix bad performance on deeply nested binary expressions
2019-03-25 07:26:04 +09:00
Seiichi Uchida
929d8a9494
Merge pull request #3459 from scampi/issue-3442
fix line numbering in missed spans and handle file_lines in edge cases
2019-03-25 07:25:28 +09:00
Seiichi Uchida
a5cc780c98
Merge pull request #3468 from topecongiro/refactor-create_config
Move some code out of create_config
2019-03-25 07:24:57 +09:00
Seiichi Uchida
9b4344161b
Merge pull request #3466 from topecongiro/discard-error-to-sink
Discard error report in silent_emitter
2019-03-25 07:24:42 +09:00
Stéphane Campinas
cc26c5eaca
Merge pull request #3454 from rchaser53/issue-3434
add new attribute rustfmt::skip::macros
2019-03-24 22:29:56 +01:00
topecongiro
0d67db4744 Move some code out of create_config 2019-03-24 23:36:07 +09:00
topecongiro
abfb381189 Avoid rewriting pairs mutiple times 2019-03-24 18:55:11 +09:00
topecongiro
037cf2c436 Discard every parsing error in silent_emitter
`EmitterWriter` from rustc is wasting soooo much time constructing an error
message that will never be emitted, instead we just implement our own `Emitter`
that just discards every error message.
2019-03-24 17:44:55 +09:00
rchaser53
1d9104bbae reflect scampi review
- fix README.md
- fix BadAttr doc
- is_rustfmt_macro_error => is_unknown_rustfmt_attr
2019-03-21 21:45:57 +09:00
rchaser53
bbbc1e86eb refrect topecongiro reviews
- &Vec<syntax::ast::PathSegment> => &[ast::PathSegment]
    - remove unnecessary implements
    - transfer skip logic to inside rewrite_macro
    - fix test
    - use util methods in libsyntax
    - use meta_item_list directly
    - avoid no_entry.rs for test using module system
    - add logic to skip rustfmt::skip::macros only
    - remove base_skip_macro_names
    - remove Rc
    - use clone to append skip_macro_names
2019-03-21 21:45:39 +09:00
Seiichi Uchida
94b381f1cc
Merge pull request #3464 from topecongiro/issue-3463
Avoid duplication on the presence of spaces between macro name and !
2019-03-21 20:32:29 +09:00
topecongiro
017e491a17 Avoid duplication on the presence of spaces between macro name and ! 2019-03-21 15:58:39 +09:00
Stjepan Glavina
1fa06ecf1e Fix formatting of async blocks 2019-03-20 18:18:02 +01:00
rchaser53
f493a59783 use RefCell and Rc 2019-03-21 00:19:52 +09:00