-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Split missing_docs_in_private_items
into various lints
#5736
Comments
A quick If this is something that is desired, I'd be interested in contributing once I get some free time. |
Maybe even better: Don't split it, but make it configurable, so that you can configure it to only warn on functions for example. |
That could certainly work, and would be backwards-compatible as well. |
Another situation I've found myself allowing the lint regularly is |
I think we should not lint at all on definitions inside a function. |
On This has the undesired effect of not being able to detect unused items because they are public. If this lint could be configured to detect missing docs in Let me know if this would be a reasonable change and I will start working on it. |
I could see a config option, that you can set to specify if the lint should lint on all private items or only on crate items. All private items should be the default though. Let me know if you need help implementing this. |
Add configuration to lint missing docs of `pub(crate)` items Fixes this: #5736 (comment) TODO: - [x] Needs docs - [x] Needs better names - [x] Should `pub` items be checked to when this new option is enabled? I'm saying no because `missing_docs` already exists `@flip1995` I'd like to get some input from you :) --- changelog: Enhancement: [`missing_docs_in_private_items`]: Added new configuration `missing-docs-in-crate-items` to lint on items visible within the current crate. For example, `pub(crate)` items. [#10303](#10303) <!-- changelog_checked -->
Don't lint unnamed consts and nested items within functions in `missing_docs_in_private_items` With this change we no longer require doc comments for `const _: ()` items as well as nested items in functions or other bodies. In both of those cases, rustdoc generates no documentation even with `--document-private-items`. Fixes #13427 (first commit) Fixes #13298 (second commit) cc #5736 (comment) changelog: [`missing_docs_in_private_items`]: avoid linting in more cases where rustdoc generates no documentation
Would it be feasible and acceptable to split
missing_docs_in_private_items
into a few different lints? I find myself quite frequently adding#[allow]
toenum
variants andstruct
fields, in large part because the naming is typically self-explanatory. Even splitting the lint in two (fields/variants and everything else) would be incredibly useful for me, and would avoid cluttering declarations with unnecessary (imo)#[allow]
attributes.Having different lints for modules and top-level crate documentation would also be great, but are less important to me.
The text was updated successfully, but these errors were encountered: