Comments (2)
Great idea! but I think maybe it'd be better if it could be implemented in rustfmt
? Plus it already has a bunch of options to change the style of imports.
from rust-clippy.
Fair point, but I personally think it'd be better living here (or both); It'd make it available for projects not using rustfmt
, and as you said, rustfmt
already has a decent amount of complexity and options for customizing imports; I think it would add a lot of complexity to the configuration to allow all different styles (prefer crate::
, prefer super::
, prefer self::
, allow mixing all of these, don't allow mixing any of these, allow mixing only some two of those three, etc.).
I think as a lint (or a few) it could be quite simple — It could be lints like crate_imports = "allow"
, self_imports = "allow"
, and "super_imports = "allow"
, which would allow many different combinations based on preference from just those few lints. Alternatively, if it's too big of a jump to add in 3 lints to solve one problem, there could simply be a mixed_imports = "warn"
lint or something along those lines, that has no preference for crate::
, self::
and super::
imports, but at least warns against mixing those different types.
Not that this would be bad for rustfmt
, but I think from a configuration standpoint, having it as a lint(s) would be simpler to handle and customize, in addition to giving access to this for projects that don't use rustfmt
.
from rust-clippy.
Related Issues (20)
- `indexing_slicing` emitting errors on proc-macro code.
- compiler told me to file this ... HOT 2
- Following `manual_clamp` suggestion results in slower code HOT 5
- False positive HOT 2
- Use `ControlFlow` in more visitors HOT 1
- Borrow incorrectly handled when trying to simplify return statement HOT 3
- Clippy error this loop never actually loops when use loop with select! HOT 1
- `bare URLs` in `clippy::doc_markdown` lint should have a `Quick Fix` HOT 1
- Some warnings are not reported if rust-src component is not installed HOT 2
- [`needless_bool`] suggestion cause error when the `if` expression is a method caller
- assertions_on_constants should not trigger inside `const` blocks HOT 2
- index out of bounds when compiling my os HOT 6
- `redundant_closure` doesn't handle `Fn` HOT 1
- Error with latest nightly HOT 2
- lines().count() should warn in case of Err
- unnecessary_cast false positive when casting pointers to types with lifetime parameters
- False Negative of `clippy::manual_strip` HOT 4
- Lint against `HashMap`s where the key is not `Eq + Hash` HOT 1
- `implicit_return` false positive inside `tauri::command` macro
- internal error: relating different kinds: `jni::objects::JObject<'?14> '?1`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-clippy.