about summary refs log tree commit diff
path: root/src/librustdoc/lint.rs
AgeCommit message (Collapse)AuthorLines
2021-07-03Warn when `rustdoc::` group is omitted from lint namesJoshua Nelson-1/+1
2021-05-17Rename INVALID_RUST_CODEBLOCK{,S}Joshua Nelson-4/+4
2021-05-17New rustdoc lint to respect -Dwarnings correctlyAlexis Bourget-0/+13
This adds a new lint to `rustc` that is used in rustdoc when a code block is empty or cannot be parsed as valid Rust code. Previously this was unconditionally a warning. As such some documentation comments were (unknowingly) abusing this to pass despite the `-Dwarnings` used when compiling `rustc`, this should not be the case anymore.
2021-04-05Apply suggestions from code reviewJoshua Nelson-1/+1
Co-authored-by: Camelid <camelidcamel@gmail.com> Co-authored-by: Nemo157 <github@nemo157.com>
2021-04-05Rename non_autolinks -> bare_urlsJoshua Nelson-7/+8
2021-03-16Don't warn about old rustdoc lint names (temporarily)Joshua Nelson-1/+1
Right now, rustdoc users have an unpleasant situation: they can either use the new tool lint names (`rustdoc::non_autolinks`) or they can use the old names (`non_autolinks`). If they use the tool lints, they get a hard error on stable compilers, because rustc rejects all tool names it doesn't recognize. If they use the old name, they get a warning to rename the lint to the new name. The only way to compile without warnings is to add `#[allow(renamed_removed_lints)]`, which defeats the whole point of the change: we *want* people to switch to the new name. To avoid people silencing the lint and never migrating to the tool lint, this avoids warning about the old name, while still allowing you to use the new name. Once the new `rustdoc` tool name makes it to the stable channel, we can change these lints to warn again. This adds the new lint functions `register_alias` and `register_ignored` - I didn't see an existing way to do this.
2021-03-05Rename `rustdoc` to `rustdoc::all`Joshua Nelson-2/+2
When rustdoc lints were changed to be tool lints, the `rustdoc` group was removed, leading to spurious warnings like ``` warning: unknown lint: `rustdoc` ``` The lint group still worked when rustdoc ran, since rustdoc added the group itself. This renames the group to `rustdoc::all` for consistency with `clippy::all` and the rest of the rustdoc lints.
2021-03-01Address review commentsJoshua Nelson-0/+12
- Move MISSING_CRATE_LEVEL_DOCS to rustdoc directly - Update documentation This also takes the opportunity to make the `no-crate-level-doc-lint` test more specific.
2021-03-01Improve error messagesJoshua Nelson-0/+4
- Use `register_renamed` when rustdoc is running so the lint will still be active and use a structured suggestion - Test the behavior for rustc, not just for rustdoc (because it differs)
2021-03-01Add `declare_rustdoc_lint!` macroJoshua Nelson-14/+22
2021-03-01Move lint machinery into a separate fileJoshua Nelson-0/+164