mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-09 13:33:43 +00:00
Run rustfix for bare-urls
test
This will help us ensure that it emits valid suggestions.
This commit is contained in:
parent
d931e2b7bf
commit
aabc363bc2
60
src/test/rustdoc-ui/bare-urls.fixed
Normal file
60
src/test/rustdoc-ui/bare-urls.fixed
Normal file
@ -0,0 +1,60 @@
|
||||
// run-rustfix
|
||||
|
||||
#![deny(rustdoc::bare_urls)]
|
||||
|
||||
/// <https://somewhere.com>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://somewhere.com/a>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://www.somewhere.com>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://www.somewhere.com/a>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://subdomain.example.com>
|
||||
//~^ ERROR not a hyperlink
|
||||
/// <https://somewhere.com?>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://somewhere.com/a?>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://somewhere.com?hello=12>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://somewhere.com/a?hello=12>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://example.com?hello=12#xyz>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://example.com/a?hello=12#xyz>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://example.com#xyz>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://example.com/a#xyz>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://somewhere.com?hello=12&bye=11>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://somewhere.com/a?hello=12&bye=11>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// <https://somewhere.com?hello=12&bye=11#xyz>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
/// hey! <https://somewhere.com/a?hello=12&bye=11#xyz>
|
||||
//~^ ERROR this URL is not a hyperlink
|
||||
pub fn c() {}
|
||||
|
||||
/// <https://somewhere.com>
|
||||
/// [a](http://a.com)
|
||||
/// [b]
|
||||
///
|
||||
/// [b]: http://b.com
|
||||
///
|
||||
/// ```
|
||||
/// This link should not be linted: http://example.com
|
||||
///
|
||||
/// Nor this one: <http://example.com> or this one: [x](http://example.com)
|
||||
/// ```
|
||||
///
|
||||
/// [should_not.lint](should_not.lint)
|
||||
pub fn everything_is_fine_here() {}
|
||||
|
||||
#[allow(rustdoc::bare_urls)]
|
||||
pub mod foo {
|
||||
/// https://somewhere.com/a?hello=12&bye=11#xyz
|
||||
pub fn bar() {}
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
// run-rustfix
|
||||
|
||||
#![deny(rustdoc::bare_urls)]
|
||||
|
||||
/// https://somewhere.com
|
||||
|
@ -1,107 +1,107 @@
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:3:5
|
||||
--> $DIR/bare-urls.rs:5:5
|
||||
|
|
||||
LL | /// https://somewhere.com
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com>`
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/bare-urls.rs:1:9
|
||||
--> $DIR/bare-urls.rs:3:9
|
||||
|
|
||||
LL | #![deny(rustdoc::bare_urls)]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:5:5
|
||||
--> $DIR/bare-urls.rs:7:5
|
||||
|
|
||||
LL | /// https://somewhere.com/a
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:7:5
|
||||
--> $DIR/bare-urls.rs:9:5
|
||||
|
|
||||
LL | /// https://www.somewhere.com
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://www.somewhere.com>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:9:5
|
||||
--> $DIR/bare-urls.rs:11:5
|
||||
|
|
||||
LL | /// https://www.somewhere.com/a
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://www.somewhere.com/a>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:11:5
|
||||
--> $DIR/bare-urls.rs:13:5
|
||||
|
|
||||
LL | /// https://subdomain.example.com
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://subdomain.example.com>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:13:5
|
||||
--> $DIR/bare-urls.rs:15:5
|
||||
|
|
||||
LL | /// https://somewhere.com?
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:15:5
|
||||
--> $DIR/bare-urls.rs:17:5
|
||||
|
|
||||
LL | /// https://somewhere.com/a?
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:17:5
|
||||
--> $DIR/bare-urls.rs:19:5
|
||||
|
|
||||
LL | /// https://somewhere.com?hello=12
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:19:5
|
||||
--> $DIR/bare-urls.rs:21:5
|
||||
|
|
||||
LL | /// https://somewhere.com/a?hello=12
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:21:5
|
||||
--> $DIR/bare-urls.rs:23:5
|
||||
|
|
||||
LL | /// https://example.com?hello=12#xyz
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com?hello=12#xyz>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:23:5
|
||||
--> $DIR/bare-urls.rs:25:5
|
||||
|
|
||||
LL | /// https://example.com/a?hello=12#xyz
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com/a?hello=12#xyz>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:25:5
|
||||
--> $DIR/bare-urls.rs:27:5
|
||||
|
|
||||
LL | /// https://example.com#xyz
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com#xyz>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:27:5
|
||||
--> $DIR/bare-urls.rs:29:5
|
||||
|
|
||||
LL | /// https://example.com/a#xyz
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com/a#xyz>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:29:5
|
||||
--> $DIR/bare-urls.rs:31:5
|
||||
|
|
||||
LL | /// https://somewhere.com?hello=12&bye=11
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12&bye=11>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:31:5
|
||||
--> $DIR/bare-urls.rs:33:5
|
||||
|
|
||||
LL | /// https://somewhere.com/a?hello=12&bye=11
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12&bye=11>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:33:5
|
||||
--> $DIR/bare-urls.rs:35:5
|
||||
|
|
||||
LL | /// https://somewhere.com?hello=12&bye=11#xyz
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12&bye=11#xyz>`
|
||||
|
||||
error: this URL is not a hyperlink
|
||||
--> $DIR/bare-urls.rs:35:10
|
||||
--> $DIR/bare-urls.rs:37:10
|
||||
|
|
||||
LL | /// hey! https://somewhere.com/a?hello=12&bye=11#xyz
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12&bye=11#xyz>`
|
||||
|
Loading…
Reference in New Issue
Block a user