about summary refs log tree commit diff
path: root/src/librustdoc/lint.rs
AgeCommit message (Collapse)AuthorLines
2025-05-06rustdoc: remove unportable markdown lint and old parserMichael Howell-9/+1
Follow up https://github.com/rust-lang/rust/pull/127127
2024-11-28Fix new clippy lintsGuillaume Gomez-1/+1
2024-10-19Remove module passes filteringblyxyas-4/+3
2024-10-19Do not run lints that cannot emitblyxyas-3/+4
Before this change, adding a lint was a difficult matter because it always had some overhead involved. This was because all lints would run, no matter their default level, or if the user had #![allow]ed them. This PR changes that
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-2/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-11Auto merge of #127097 - compiler-errors:async-closure-lint, r=oli-obkbors-2/+2
Implement simple, unstable lint to suggest turning closure-of-async-block into async-closure We want to eventually suggest people to turn `|| async {}` to `async || {}`. This begins doing that. It's a pretty rudimentary lint, but I wanted to get something down so I wouldn't lose the code. Tracking: * #62290
2024-07-01rustdoc: add usable lint for pulldown-cmark-0.11 parsing changesMichael Howell-0/+9
2024-06-28Only require symbol name for @feature_gateMichael Goulet-2/+2
2024-04-24chore: fix some typos in commentswhosehang-1/+1
Signed-off-by: whosehang <whosehang@outlook.com>
2023-12-22fix some typos found scrolling through the docsTakashi Idobe-2/+2
2023-12-15NFC don't convert types to identical typesMatthias Krüger-2/+2
2023-08-18Add warn level lint `redundant_explicit_links`Kyle Lin-0/+12
- Currently it will panic due to the resolution's caching issue
2023-04-29Add `rustdoc::unescaped_backtick` lintLukas Markeffsky-0/+12
2023-02-19Only include stable lints in `rustdoc::all` groupNoah Lev-1/+5
Including unstable lints in the lint group produces unintuitive behavior on stable (see #106289). Meanwhile, if we only included unstable lints on nightly and not on stable, we could end up with confusing bugs that were hard to compare across versions of Rust that lacked code changes. I think that only including stable lints in `rustdoc::all`, no matter the release channel, is the most intuitive option. Users can then control unstable lints individually, which is reasonable since they have to enable the feature gates individually anyway.
2022-10-10Change default lint level of INVALID_HTML_TAGS to warningGuillaume Gomez-1/+1
2022-09-12Feature gate the rustdoc::missing_doc_code_examples lintWim Looman-2/+7
2022-06-16Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`Maybe Waffle-1/+1
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-2/+2
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