2016-03-19 11:59:12 -05:00
|
|
|
|
//! This file tests for the DOC_MARKDOWN lint
|
|
|
|
|
//~^ ERROR: you should put `DOC_MARKDOWN` between ticks
|
|
|
|
|
|
|
|
|
|
#![feature(plugin)]
|
|
|
|
|
#![plugin(clippy)]
|
|
|
|
|
|
|
|
|
|
#![deny(doc_markdown)]
|
|
|
|
|
|
2016-03-28 11:00:24 -05:00
|
|
|
|
/// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `foo_bar` between ticks
|
|
|
|
|
//~| ERROR: you should put `foo::bar` between ticks
|
2016-03-28 11:00:24 -05:00
|
|
|
|
/// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. But not Foo::some_fun
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `Foo::some_fun` between ticks
|
2016-03-28 11:00:24 -05:00
|
|
|
|
/// which should be reported only once despite being __doubly bad__.
|
2016-05-26 15:53:38 -05:00
|
|
|
|
/// Here be ::is::a::global:path.
|
|
|
|
|
//~^ ERROR: you should put `is::a::global:path` between ticks
|
2016-07-08 11:18:45 -05:00
|
|
|
|
/// That's not code ~NotInCodeBlock~.
|
|
|
|
|
//~^ ERROR: you should put `NotInCodeBlock` between ticks
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// be_sure_we_got_to_the_end_of_it
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
2016-03-19 11:59:12 -05:00
|
|
|
|
fn foo_bar() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// That one tests multiline ticks.
|
|
|
|
|
/// ```rust
|
|
|
|
|
/// foo_bar FOO_BAR
|
2016-03-28 14:23:21 -05:00
|
|
|
|
/// _foo bar_
|
2016-03-19 11:59:12 -05:00
|
|
|
|
/// ```
|
2016-07-08 11:18:45 -05:00
|
|
|
|
///
|
|
|
|
|
/// ~~~rust
|
|
|
|
|
/// foo_bar FOO_BAR
|
|
|
|
|
/// _foo bar_
|
|
|
|
|
/// ~~~
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// be_sure_we_got_to_the_end_of_it
|
|
|
|
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
2016-07-08 11:18:45 -05:00
|
|
|
|
fn multiline_codeblock() {
|
2016-03-19 11:59:12 -05:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-28 14:23:21 -05:00
|
|
|
|
/// This _is a test for
|
|
|
|
|
/// multiline
|
|
|
|
|
/// emphasis_.
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// be_sure_we_got_to_the_end_of_it
|
|
|
|
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
2016-05-02 07:36:33 -05:00
|
|
|
|
fn test_emphasis() {
|
2016-03-28 14:23:21 -05:00
|
|
|
|
}
|
|
|
|
|
|
2016-04-04 13:18:17 -05:00
|
|
|
|
/// 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
|
2016-06-08 15:00:42 -05:00
|
|
|
|
/// NaN
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// be_sure_we_got_to_the_end_of_it
|
|
|
|
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
2016-05-02 07:36:33 -05:00
|
|
|
|
fn test_units() {
|
2016-04-13 09:02:44 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// This one checks we don’t try to split unicode codepoints
|
|
|
|
|
/// `ß`
|
|
|
|
|
/// `ℝ`
|
|
|
|
|
/// `💣`
|
|
|
|
|
/// `❤️`
|
|
|
|
|
/// ß_foo
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `ß_foo` between ticks
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// ℝ_foo
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `ℝ_foo` between ticks
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// 💣_foo
|
|
|
|
|
/// ❤️_foo
|
|
|
|
|
/// foo_ß
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `foo_ß` between ticks
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// foo_ℝ
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `foo_ℝ` between ticks
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// foo_💣
|
|
|
|
|
/// foo_❤️
|
2016-05-27 20:18:52 -05:00
|
|
|
|
/// [ßdummy textß][foo_1ß]
|
|
|
|
|
/// [ℝdummy textℝ][foo_2ℝ]
|
|
|
|
|
/// [💣dummy tex💣t][foo3_💣]
|
|
|
|
|
/// [❤️dummy text❤️][foo_4❤️]
|
|
|
|
|
/// [ßdummy textß](foo_5ß)
|
|
|
|
|
/// [ℝdummy textℝ](foo_6ℝ)
|
|
|
|
|
/// [💣dummy tex💣t](fo7o_💣)
|
|
|
|
|
/// [❤️dummy text❤️](foo_8❤️)
|
|
|
|
|
/// [foo1_ß]: dummy text
|
|
|
|
|
/// [foo2_ℝ]: dummy text
|
|
|
|
|
/// [foo3_💣]: dummy text
|
|
|
|
|
/// [foo4_❤️]: dummy text
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// be_sure_we_got_to_the_end_of_it
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
2016-04-13 09:02:44 -05:00
|
|
|
|
fn test_unicode() {
|
2016-04-04 13:18:17 -05:00
|
|
|
|
}
|
|
|
|
|
|
2016-04-11 16:22:30 -05:00
|
|
|
|
/// This test has [a link_with_underscores][chunked-example] inside it. See #823.
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `link_with_underscores` between ticks
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// 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].
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `inline_link2` between ticks
|
2016-04-01 10:24:55 -05:00
|
|
|
|
///
|
2016-04-11 16:22:30 -05:00
|
|
|
|
/// [chunked-example]: https://en.wikipedia.org/wiki/Chunked_transfer_encoding#Example
|
|
|
|
|
/// [inline_link]: https://foobar
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// [inline_link2]: https://foobar
|
2016-04-01 10:24:55 -05:00
|
|
|
|
|
2016-03-19 11:59:12 -05:00
|
|
|
|
/// The `main` function is the entry point of the program. Here it only calls the `foo_bar` and
|
|
|
|
|
/// `multiline_ticks` functions.
|
2016-04-11 16:22:30 -05:00
|
|
|
|
///
|
|
|
|
|
/// expression of the type `_ <bit_op> m <cmp_op> c` (where `<bit_op>`
|
|
|
|
|
/// is one of {`&`, '|'} and `<cmp_op>` is one of {`!=`, `>=`, `>` ,
|
2016-04-13 09:02:44 -05:00
|
|
|
|
/// be_sure_we_got_to_the_end_of_it
|
2016-05-02 07:36:33 -05:00
|
|
|
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
2016-03-19 11:59:12 -05:00
|
|
|
|
fn main() {
|
|
|
|
|
foo_bar();
|
2016-07-08 11:18:45 -05:00
|
|
|
|
multiline_codeblock();
|
2016-03-28 14:23:21 -05:00
|
|
|
|
test_emphasis();
|
2016-04-04 13:18:17 -05:00
|
|
|
|
test_units();
|
2016-03-19 11:59:12 -05:00
|
|
|
|
}
|
2016-05-05 14:32:48 -05:00
|
|
|
|
|
2016-05-05 14:42:59 -05:00
|
|
|
|
/// ## CamelCaseThing
|
|
|
|
|
/// Talks about `CamelCaseThing`. Titles should be ignored, see issue #897.
|
|
|
|
|
///
|
|
|
|
|
/// # CamelCaseThing
|
|
|
|
|
///
|
|
|
|
|
/// Not a title #897 CamelCaseThing
|
|
|
|
|
//~^ ERROR: you should put `CamelCaseThing` between ticks
|
|
|
|
|
/// be_sure_we_got_to_the_end_of_it
|
|
|
|
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
|
|
|
|
fn issue897() {
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-05 14:32:48 -05:00
|
|
|
|
/// I am confused by brackets? (`x_y`)
|
|
|
|
|
/// I am confused by brackets? (foo `x_y`)
|
|
|
|
|
/// I am confused by brackets? (`x_y` foo)
|
|
|
|
|
/// be_sure_we_got_to_the_end_of_it
|
|
|
|
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
|
|
|
|
fn issue900() {
|
|
|
|
|
}
|
2016-05-05 14:34:42 -05:00
|
|
|
|
|
|
|
|
|
/// Diesel queries also have a similar problem to [Iterator][iterator], where
|
|
|
|
|
/// /// More talking
|
|
|
|
|
/// returning them from a function requires exposing the implementation of that
|
|
|
|
|
/// function. The [`helper_types`][helper_types] module exists to help with this,
|
|
|
|
|
/// but you might want to hide the return type or have it conditionally change.
|
|
|
|
|
/// Boxing can achieve both.
|
|
|
|
|
///
|
|
|
|
|
/// [iterator]: https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html
|
|
|
|
|
/// [helper_types]: ../helper_types/index.html
|
|
|
|
|
/// be_sure_we_got_to_the_end_of_it
|
|
|
|
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
|
|
|
|
fn issue883() {
|
|
|
|
|
}
|
2016-05-26 15:53:38 -05:00
|
|
|
|
|
|
|
|
|
/// `foo_bar
|
|
|
|
|
/// baz_quz`
|
2016-05-27 20:18:52 -05:00
|
|
|
|
/// [foo
|
|
|
|
|
/// bar](https://doc.rust-lang.org/stable/std/iter/trait.IteratorFooBar.html)
|
2016-05-26 15:53:38 -05:00
|
|
|
|
fn multiline() {
|
|
|
|
|
}
|
2016-07-08 11:18:45 -05:00
|
|
|
|
|
|
|
|
|
/** E.g. serialization of an empty list: FooBar
|
|
|
|
|
```
|
|
|
|
|
That's in a code block: `PackedNode`
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
And BarQuz too.
|
|
|
|
|
be_sure_we_got_to_the_end_of_it
|
|
|
|
|
*/
|
|
|
|
|
//~^^^^^^^^ ERROR: you should put `FooBar` between ticks
|
|
|
|
|
//~^^^^ ERROR: you should put `BarQuz` between ticks
|
|
|
|
|
//~^^^^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
|
|
|
|
fn issue1073() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** E.g. serialization of an empty list: FooBar
|
|
|
|
|
```
|
|
|
|
|
That's in a code block: PackedNode
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
And BarQuz too.
|
|
|
|
|
be_sure_we_got_to_the_end_of_it
|
|
|
|
|
*/
|
|
|
|
|
//~^^^^^^^^ ERROR: you should put `FooBar` between ticks
|
|
|
|
|
//~^^^^ ERROR: you should put `BarQuz` between ticks
|
|
|
|
|
//~^^^^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
|
|
|
|
fn issue1073_alt() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Test more than three quotes:
|
|
|
|
|
/// ````
|
|
|
|
|
/// DoNotWarn
|
|
|
|
|
/// ```
|
|
|
|
|
/// StillDont
|
|
|
|
|
/// ````
|
|
|
|
|
/// be_sure_we_got_to_the_end_of_it
|
|
|
|
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
|
|
|
|
fn four_quotes() {
|
|
|
|
|
}
|