Commit Graph

43 Commits

Author SHA1 Message Date
Michele d'Amico
76e2ba25bd #3665: Implemented (#3689) 2019-07-17 09:40:33 +09:00
Seiichi Uchida
47a11cd516
Format modules defined in cfg_attr (#3604) 2019-06-09 09:20:39 +09:00
Seiichi Uchida
2244f326e6
Cargo update (#3559)
Update `rustc-ap-*` crates to 486.0.0.
2019-06-03 23:57:02 +09:00
Ruben Schmidmeister
11a68d313a
Pass string instead of Symbol to DocCommentFormatter 2019-05-18 11:47:54 +02:00
Ruben Schmidmeister
9b98dd774e
Merge branch 'master' into normalize-multiline-doc-attributes 2019-05-18 11:27:35 +02:00
Ruben Schmidmeister
6a406a822d
Return iterator instead of collecting early 2019-05-14 20:38:28 +02:00
Ruben Schmidmeister
47a0f78b3b
Fix normalisation of multi-line doc attributes 2019-05-11 15:07:16 +02:00
Ruben Schmidmeister
d1c1f8e61e
Run rustfmt 2019-05-09 21:13:32 +02:00
Ruben Schmidmeister
618d092bf7
Enable unreachable_pub lint 2019-05-09 20:37:51 +02:00
Alexander Regueiro
7a3b7c9275 Various cosmetic improvements (#3403) 2019-02-19 11:56:42 +09:00
Hirokazu Hata
4bb90f5cc8 Fix rust_2018_idioms warnings 2019-02-09 16:14:30 +09:00
Evgenii
da2d8a4c57 calculate statement first line properly 2019-02-06 10:05:51 +03:00
Evgenii
ece629b1cc transition to Rust 2018 2019-02-04 13:30:43 +03:00
Rémy Rakic
83d1d9aa14 normalize_doc_attributes: remove leading whitespace from the doc comment opener
Remove possible whitespace from the `CommentStyle::opener()` so that the literal itself has control over the comment's leading spaces.

This is most useful for tools, such as bindgen, to allow for example: machine-readable comments with precise syntax rules, or idempotently round-tripping between the proc-macro API and rustfmt.
2018-11-05 18:24:36 +01:00
Nick Cameron
8b709c0019 Add attr_fn_like_width to the width heuristics
It is a bit larger than than `fn_call_width` which we used previously, so fewer attributes get reformatted.

Closes #2929
2018-10-12 15:20:42 +13:00
Seiichi Uchida
d7e1f0006a Put arguments of the fail attribute on the same line as println! 2018-09-30 08:05:45 +09:00
Seiichi Uchida
e2b9c66cc9 Cargo fmt 2018-09-19 23:22:26 +09:00
Rémy Rakic
6c96ab7c9a address review comment in Attribute rewrite fn 2018-09-13 01:13:07 +02: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
Maximilian Roos
968affc3e0
final clippy changes 2018-09-01 16:32:38 -04:00
Seiichi Uchida
0d60f6715d Use span_ends_with_comma to find a trailing comma in an attribute 2018-08-27 16:37:58 +09:00
cad97
04d804c365 Rename CodeMap/FileMap to SourceMap/SourceFile
#2946
2018-08-23 17:10:46 -04:00
Nick Cameron
803d000ed3
Merge pull request #2900 from topecongiro/combine-attrs
Combine function-like attributes
2018-08-06 19:37:05 +12:00
Seiichi Uchida
b1c241ea72 Combine list-like attributes 2018-08-06 08:10:19 +09:00
Seiichi Uchida
e5c79bb26b Fix imports 2018-08-03 22:14:45 +09:00
Seiichi Uchida
024c03e81b Use builder pattern for ListFormatting 2018-08-03 22:13:20 +09:00
Nick Cameron
486f8fd8e7 Fixup formatting of tests and source 2018-07-12 21:37:28 +12:00
Nick Cameron
3abebf95ce Apply short function call heuristic to attributes
Closes #2620
2018-06-26 15:18:17 +12:00
Nick Cameron
42f03458dd Refactor and fixup attribute formatting
Preserves trailing commas (except in derives where we follow function args).
Correctly uses `#` vs `#!` for derives.
Uses block indent for derives, fixes #2805.
2018-06-26 15:18:17 +12:00
Josh Chase
ee5ff2d9e8 Add flag to the ListFormatting struct for nested imports 2018-06-19 12:13:35 -04:00
Shotaro Yamada
d1e2b80fb9 Use saturating_sub 2018-05-15 20:41:43 +09:00
Nick Cameron
7eb8bdbbd2 Format attributes with paths 2018-05-14 16:04:15 +12:00
Nick Cameron
0cc4a8d848 Update rustc_ap_syntax 2018-05-06 09:57:26 +12:00
topecongiro
61a401ae51 Use correct one line width for list attribute
Closes #2647.
2018-04-30 15:49:32 +09:00
csmoe
84d3659767 update rustc syntax 91.0.0 2018-04-08 22:22:11 +08:00
Seiichi Uchida
f6c0a0f4ed Cargo fmt 2018-03-31 14:23:40 +09:00
Seiichi Uchida
efd295a4e1 Follow indent style config when formatting attrs 2018-03-28 17:42:17 +09:00
topecongiro
c77708ff9a Use vertical layout for complex attributes 2018-03-25 15:17:41 +09:00
Shotaro Yamada
e5572bbb66 Use take_while 2018-03-22 08:34:36 +09:00
Shotaro Yamada
4757321277 Don't index a string with chars().count() 2018-03-22 08:33:18 +09:00
Seiichi Uchida
67fa394e4e Restrict the width of doc comments with comment_width
See the diff in tests/target/enum.rs for an example.
2018-03-09 09:34:13 +09:00
Seiichi Uchida
9344d2ca83 Fix a bug in attr::take_while_with_pred
Closes #2520.
2018-03-09 09:29:08 +09:00
Nick Cameron
39301ae5f2 Go back to a non-workspace structure
Kinda reverts https://github.com/rust-lang-nursery/rustfmt/pull/2419
2018-03-02 14:58:23 +13:00