Commit Graph

6 Commits

Author SHA1 Message Date
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
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
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
43f813867c add test with multiple levels of indents 2018-09-13 01:02:11 +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