Giter Site home page Giter Site logo

Comments (2)

J-ZhengLi avatar J-ZhengLi commented on June 3, 2024

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.

vi013t avatar vi013t commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.