1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! This file tests for the DOC_MARKDOWN lint
//~^ ERROR: you should put `DOC_MARKDOWN` between ticks
#![feature(plugin)]
#![plugin(clippy)]
#![deny(doc_markdown)]
/// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
/// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. But not Foo::some_fun
/// which should be reported only once despite being __doubly bad__.
/// be_sure_we_got_to_the_end_of_it
fn foo_bar() {
//~^ ERROR: you should put `foo_bar` between ticks
//~| ERROR: you should put `foo::bar` between ticks
//~| ERROR: you should put `Foo::some_fun` between ticks
//~| ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
}
/// That one tests multiline ticks.
/// ```rust
/// foo_bar FOO_BAR
/// _foo bar_
/// ```
/// be_sure_we_got_to_the_end_of_it
fn multiline_ticks() {
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
}
/// This _is a test for
/// multiline
/// emphasis_.
/// be_sure_we_got_to_the_end_of_it
fn test_emphasis() {
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
}
/// This tests units. See also #835.
/// kiB MiB GiB TiB PiB EiB
/// kib Mib Gib Tib Pib Eib
/// kB MB GB TB PB EB
/// kb Mb Gb Tb Pb Eb
/// 32kiB 32MiB 32GiB 32TiB 32PiB 32EiB
/// 32kib 32Mib 32Gib 32Tib 32Pib 32Eib
/// 32kB 32MB 32GB 32TB 32PB 32EB
/// 32kb 32Mb 32Gb 32Tb 32Pb 32Eb
/// be_sure_we_got_to_the_end_of_it
fn test_units() {
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
}
/// This one checks we don’t try to split unicode codepoints
/// `ß`
/// `ℝ`
/// `💣`
/// `❤️`
/// ß_foo
/// ℝ_foo
/// 💣_foo
/// ❤️_foo
/// foo_ß
/// foo_ℝ
/// foo_💣
/// foo_❤️
/// [ßdummy textß][foo_ß]
/// [ℝdummy textℝ][foo_ℝ]
/// [💣dummy tex💣t][foo_💣]
/// [❤️dummy text❤️][foo_❤️]
/// [ßdummy textß](foo_ß)
/// [ℝdummy textℝ](foo_ℝ)
/// [💣dummy tex💣t](foo_💣)
/// [❤️dummy text❤️](foo_❤️)
/// [foo_ß]: dummy text
/// [foo_ℝ]: dummy text
/// [foo_💣]: dummy text
/// [foo_❤️]: dummy text
/// be_sure_we_got_to_the_end_of_it
fn test_unicode() {
//~^ ERROR: you should put `ß_foo` between ticks
//~| ERROR: you should put `ℝ_foo` between ticks
//~| ERROR: you should put `foo_ß` between ticks
//~| ERROR: you should put `foo_ℝ` between ticks
//~| ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
}
/// This test has [a link_with_underscores][chunked-example] inside it. See #823.
/// See also [the issue tracker](https://github.com/Manishearth/rust-clippy/search?q=doc_markdown&type=Issues)
/// on GitHub (which is a camel-cased word, but is OK). And here is another [inline link][inline_link].
/// It can also be [inline_link2].
///
/// [chunked-example]: https://en.wikipedia.org/wiki/Chunked_transfer_encoding#Example
/// [inline_link]: https://foobar
/// [inline_link2]: https://foobar
/// The `main` function is the entry point of the program. Here it only calls the `foo_bar` and
/// `multiline_ticks` functions.
///
/// expression of the type `_ <bit_op> m <cmp_op> c` (where `<bit_op>`
/// is one of {`&`, '|'} and `<cmp_op>` is one of {`!=`, `>=`, `>` ,
/// be_sure_we_got_to_the_end_of_it
fn main() {
//~^ ERROR: you should put `inline_link2` between ticks
//~| ERROR: you should put `link_with_underscores` between ticks
//~| ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
foo_bar();
multiline_ticks();
test_emphasis();
test_units();
}