-
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
new lint: use_crate_prefix_for_self_imports #13662
base: master
Are you sure you want to change the base?
new lint: use_crate_prefix_for_self_imports #13662
Conversation
2a70749
to
bfc0849
Compare
f74a6bc
to
6a0c669
Compare
/// ``` | ||
#[clippy::version = "1.84.0"] | ||
pub USE_CRATE_PREFIX_FOR_SELF_IMPORTS, | ||
style, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I understand that clearing up possible path confusion is a worthy cause, I'm afraid that introducing the lint as warn-by-default will lead to a lot of noise and broken CI jobs.
I'll discuss this on zulip.
6a0c669
to
7633f16
Compare
So, as you know we discussed this on zulip a while ago. The upshot is that we have two acceptable options:
Do you intend to continue working on this? |
@rustbot author |
7633f16
to
5817b6f
Compare
tests/ui-cargo/use_crate_prefix_for_self_imports/pass_sibling/src/main.rs
Show resolved
Hide resolved
840f04d
to
9e1dbdc
Compare
Don't lint if mod and use in the same block |
cargo uibless
``` mod foo; use foo; ```
``` use foo; mod foo; ```
a500545
to
a3f5529
Compare
The problem of |
changelog: [
use_crate_prefix_for_self_imports
]: new lintfix #13645
Only check main.rs and lib.rs
Known problem
TODO
Question
Although pass all tests, but if copy
lintcheck
to/tmp
, clippy will report two warnings (expected)