Git Product home page Git Product logo

Comments (5)

lyz-code avatar lyz-code commented on June 23, 2024

Hi @dbatten5 , thank you for taking the time to open the issue and volunteering to do a PR. I'm afraid it's a "feature", autoimport parses the source code and divides it into four sections: header, imports, typing, and code. You can see it here. I thought it was interesting to add a new line between each section to improve readability.

That being said, I'm not against adding a config option to disable this behaviour. Sadly, autoimport doesn't yet have that feature implemented, so there is no way to deviate from the standard opinionated workflow. This has been raised too in yamlfix another fixer I maintain. If you were to make a PR I'd point in that direction.

Ideally for me, autoimport could read it's configuration from a section in the pyproject.toml project file, to avoid creating new fixer files in the repository, but if you have other ideas, I'm more than open to them.

from autoimport.

dbatten5 avatar dbatten5 commented on June 23, 2024

hi @lyz-code yeah i think reading from pyproject.toml would be a good starting point. i'd be happy to try and implement that and once that's in place could tackle the blank line config option?

from autoimport.

lyz-code avatar lyz-code commented on June 23, 2024

Sounds really good to me :)

from autoimport.

dbatten5 avatar dbatten5 commented on June 23, 2024

just coming back to this now - i think this is mentioned in the docs as well but typically i just run black after autoimport which resolves any potential formatting issues. happy to close this issue as i don't really see it as an issue any more

from autoimport.

lyz-code avatar lyz-code commented on June 23, 2024

I'm fine with closing it too, if anyone still sees it as an issue, please
comment here and we'll reopen it.

from autoimport.

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.