-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
triggers for integration tests
#137561
Comments
Note that |
Similar: rust-lang/rust-clippy#11024 |
Yes, true. Should I move this issue elsewhere? I'm not very clear on the whole clippy-vs-rustc thing, apart from the work started in rustc and then got expanded as clippy. |
Workaround is to enable it in the root module of your crate, instead of in |
Though there was a related issue at #24584, where the behavior before 1.82 was a little awkward. If you are running There seems to be some conflicting desires on how that behaves. |
The change in #130025 was a bug-fix to make The change in behavior was in the "Compatibility Notes" of 1.83.0:
I don't think there is anything (on rustc's side) to do here, the behavior is expected and IMO wanted, lints should be predictable and consistent. I disagree that it makes " In any case, one case always put |
I didn't realize rustc doesn't know if its running an integration test or unit test. It's easy to forget how relatively simple |
I have a workspace with lots of crates, so that's not a great answer. |
Summary
If you warn on
missing_docs
, every integration test causes a warning fromclippy --tests
.I think integration tests should be exempt from
missing_docs
.My editor (https://zed.dev) (and maybe rust-analyzer by default?) shows
clippy --tests
messages too (and not justclippy
), so having any integration tests in the tree makesmissing_docs
practically unusable.Lint Name
missing_docs
Reproducer
Using the
fn add
example fromcargo init --lib
Add to
Cargo.toml
add new file
tests/two_plus_two.rs
And now
clippy --tests
complains:Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: