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 method doc comments which contain no examples that call the method #1454

Open
clarfonthey opened this issue Jan 20, 2017 · 1 comment
Open
Labels
A-lint Area: New lints E-hard Call for participation: This a hard problem and requires more experience or effort to work on T-middle Type: Probably requires verifiying types

Comments

@clarfonthey
Copy link
Contributor

Sort of long explanation for a simple thing: it's very common in Rust to provide code examples in doc comments to explain how a method is used. However, sometimes methods are the same, and we accidentally copy-paste a doc comment which does not actually call the method it's documenting. This should warn by default, because it's probably a mistake.

I don't think that this warning should warn for doc comments which don't contain code examples, just specifically ones that don't call the thing they're documenting. The former would be better for rustfmt, whereas the latter is something that would be good for a linter like clippy.

@mcarton mcarton added E-hard Call for participation: This a hard problem and requires more experience or effort to work on A-lint Area: New lints T-middle Type: Probably requires verifiying types labels Jun 10, 2017
@mcarton
Copy link
Member

mcarton commented Jun 10, 2017

I think that is quite hard because we don't ever lint doc examples, but maybe that would be possible somehow, don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints E-hard Call for participation: This a hard problem and requires more experience or effort to work on T-middle Type: Probably requires verifiying types
Projects
None yet
Development

No branches or pull requests

2 participants