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

Lint doc comments on private items #786

Closed
llogiq opened this issue Mar 22, 2016 · 7 comments
Closed

Lint doc comments on private items #786

llogiq opened this issue Mar 22, 2016 · 7 comments
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-style Lint: Belongs in the style lint group T-middle Type: Probably requires verifiying types

Comments

@llogiq
Copy link
Contributor

llogiq commented Mar 22, 2016

Since we recently started targeting comments, recently someone asked why their doc comments don't show up for a private function.

We could lint and suggest either making the function public (if intended) or make the comment a normal line comment.

I'm not sure if this should warn, though.

@mcarton
Copy link
Member

mcarton commented Mar 22, 2016

I'm not sure if this should warn, though.

Nah. I like to use that trick to generate private doc. I think this is something cargo doc should support.

@llogiq
Copy link
Contributor Author

llogiq commented Mar 22, 2016

OK, but that's something a well-seasoned dev would attempt, and clippy also tries to help newbies (and forgetting pub is at least as likely than documenting private functions just because, then wondering why the docs fail to show).

@oli-obk oli-obk added L-style Lint: Belongs in the style lint group 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 May 10, 2017
@shepmaster
Copy link
Member

Conversely, I'd like a lint to warn when a private function is not documented.

Since rustdoc's behavior around documenting private items has changed greatly (e.g. binaries include them by default, you can use --document-private-items) perhaps this issue should be closed or repurposed.

@flip1995
Copy link
Member

flip1995 commented Jul 28, 2020

@shepmaster this lint already exists: missing_docs_in_private_items, but has to be enabled explicitely. (Also it will lint on all private items, not only functions.)

@shepmaster
Copy link
Member

this lint already exists

Ah, thanks! I only looked for an official rustdoc lint.

@flip1995
Copy link
Member

See also #5736

@BatmanAoD
Copy link
Member

I agree this should be closed.

@Alexendoo Alexendoo closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2024
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 L-style Lint: Belongs in the style lint group T-middle Type: Probably requires verifiying types
Projects
None yet
Development

No branches or pull requests

8 participants