Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow GraphQL in docs without backticks #5996

Merged
merged 2 commits into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ define_Conf! {
"IPv4", "IPv6",
"ClojureScript", "CoffeeScript", "JavaScript", "PureScript", "TypeScript",
"NaN", "NaNs",
"OAuth",
"OAuth", "GraphQL",
"OCaml",
"OpenGL", "OpenMP", "OpenSSH", "OpenSSL", "OpenStreetMap",
"TensorFlow",
Expand Down
13 changes: 10 additions & 3 deletions tests/ui/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ fn test_emphasis() {
fn test_units() {
}

/// This tests allowed identifiers.
/// DirectX
/// ECMAScript
/// OAuth GraphQL
/// TeX LaTeX BibTeX BibLaTeX
/// CamelCase (see also #2395)
/// be_sure_we_got_to_the_end_of_it
fn test_allowed() {
}

/// This test has [a link_with_underscores][chunked-example] inside it. See #823.
/// See also [the issue tracker](https://github.com/rust-lang/rust-clippy/search?q=clippy::doc_markdown&type=Issues)
/// on GitHub (which is a camel-cased word, but is OK). And here is another [inline link][inline_link].
Expand Down Expand Up @@ -168,9 +178,6 @@ fn issue_1920() {}
/// Not ok: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels
fn issue_1832() {}

/// Ok: CamelCase (It should not be surrounded by backticks)
fn issue_2395() {}

/// An iterator over mycrate::Collection's values.
/// It should not lint a `'static` lifetime in ticks.
fn issue_2210() {}
Expand Down
50 changes: 28 additions & 22 deletions tests/ui/doc.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -54,131 +54,137 @@ error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the doc
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:58:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: you should put `link_with_underscores` between ticks in the documentation
--> $DIR/doc.rs:52:22
--> $DIR/doc.rs:62:22
|
LL | /// This test has [a link_with_underscores][chunked-example] inside it. See #823.
| ^^^^^^^^^^^^^^^^^^^^^

error: you should put `inline_link2` between ticks in the documentation
--> $DIR/doc.rs:55:21
--> $DIR/doc.rs:65:21
|
LL | /// It can also be [inline_link2].
| ^^^^^^^^^^^^

error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:65:5
--> $DIR/doc.rs:75:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: you should put `CamelCaseThing` between ticks in the documentation
--> $DIR/doc.rs:73:8
--> $DIR/doc.rs:83:8
|
LL | /// ## CamelCaseThing
| ^^^^^^^^^^^^^^

error: you should put `CamelCaseThing` between ticks in the documentation
--> $DIR/doc.rs:76:7
--> $DIR/doc.rs:86:7
|
LL | /// # CamelCaseThing
| ^^^^^^^^^^^^^^

error: you should put `CamelCaseThing` between ticks in the documentation
--> $DIR/doc.rs:78:22
--> $DIR/doc.rs:88:22
|
LL | /// Not a title #897 CamelCaseThing
| ^^^^^^^^^^^^^^

error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:79:5
--> $DIR/doc.rs:89:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:86:5
--> $DIR/doc.rs:96:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:99:5
--> $DIR/doc.rs:109:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: you should put `FooBar` between ticks in the documentation
--> $DIR/doc.rs:110:43
--> $DIR/doc.rs:120:43
|
LL | /** E.g., serialization of an empty list: FooBar
| ^^^^^^

error: you should put `BarQuz` between ticks in the documentation
--> $DIR/doc.rs:115:5
--> $DIR/doc.rs:125:5
|
LL | And BarQuz too.
| ^^^^^^

error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:116:1
--> $DIR/doc.rs:126:1
|
LL | be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: you should put `FooBar` between ticks in the documentation
--> $DIR/doc.rs:121:43
--> $DIR/doc.rs:131:43
|
LL | /** E.g., serialization of an empty list: FooBar
| ^^^^^^

error: you should put `BarQuz` between ticks in the documentation
--> $DIR/doc.rs:126:5
--> $DIR/doc.rs:136:5
|
LL | And BarQuz too.
| ^^^^^^

error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:127:1
--> $DIR/doc.rs:137:1
|
LL | be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: you should put `be_sure_we_got_to_the_end_of_it` between ticks in the documentation
--> $DIR/doc.rs:138:5
--> $DIR/doc.rs:148:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: you should put bare URLs between `<`/`>` or make a proper Markdown link
--> $DIR/doc.rs:165:13
--> $DIR/doc.rs:175:13
|
LL | /// Not ok: http://www.unicode.org
| ^^^^^^^^^^^^^^^^^^^^^^

error: you should put bare URLs between `<`/`>` or make a proper Markdown link
--> $DIR/doc.rs:166:13
--> $DIR/doc.rs:176:13
|
LL | /// Not ok: https://www.unicode.org
| ^^^^^^^^^^^^^^^^^^^^^^^

error: you should put bare URLs between `<`/`>` or make a proper Markdown link
--> $DIR/doc.rs:167:13
--> $DIR/doc.rs:177:13
|
LL | /// Not ok: http://www.unicode.org/
| ^^^^^^^^^^^^^^^^^^^^^^

error: you should put bare URLs between `<`/`>` or make a proper Markdown link
--> $DIR/doc.rs:168:13
--> $DIR/doc.rs:178:13
|
LL | /// Not ok: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: you should put `mycrate::Collection` between ticks in the documentation
--> $DIR/doc.rs:174:22
--> $DIR/doc.rs:181:22
|
LL | /// An iterator over mycrate::Collection's values.
| ^^^^^^^^^^^^^^^^^^^

error: aborting due to 30 previous errors
error: aborting due to 31 previous errors