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

missing_docs_in_private_items does not honor allow statements #1895

Closed
darnir opened this issue Jul 20, 2017 · 5 comments · Fixed by #10324
Closed

missing_docs_in_private_items does not honor allow statements #1895

darnir opened this issue Jul 20, 2017 · 5 comments · Fixed by #10324
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy T-middle Type: Probably requires verifiying types

Comments

@darnir
Copy link

darnir commented Jul 20, 2017

I tried to enable the missing_docs_in_private_items lint. I have a coupe of modules that are not documented since they don't require it. The existing rustc lint for missing_docs also flags it, but I set a #[allow(missing_docs)] to silence the lint on just that module.

Turns out clippy does not heed this specific exception and still warns me about the missing docs. Would it be possible to check if the user has tried to silence the warning on that part of the code?

@oli-obk oli-obk added good-first-issue These issues are a good way to get started with Clippy A-lint Area: New lints T-middle Type: Probably requires verifiying types labels Jul 20, 2017
@oli-obk
Copy link
Contributor

oli-obk commented Jul 20, 2017

Implementable by using cx.current_level(MISSING_DOCS) == Level::Allow.

Prerequisite is to make rustc_lint::builtin::MISSING_DOCS public in rustc.

@mcarton
Copy link
Member

mcarton commented Jul 20, 2017

IIRC, this lint is copied from rustc and merely removes the check about publicity. Does rustc suffers the same problem with public non-documented modules with missing_docs?

@darnir
Copy link
Author

darnir commented Jul 22, 2017

@mcarton As I mentioned in the original report, I have a couple of public modules which are non-documented. rustc does not complain about them once I add the #allow[missing_docs] flag to the module, but clippy still does.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 22, 2017

clippy will stop complaining if you add #[allow(missing_docs_in_private_items)]

@andrewbanchich
Copy link
Contributor

Here's a playground reproduction of this issue.

To paraphrase: missing_docs only affects public items, while clippy::missing_docs_in_private_items affects both private and public items. It should just stick to private items as the name suggests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy T-middle Type: Probably requires verifiying types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants