Giter Club home page Giter Club logo

Comments (2)

JelleZijlstra avatar JelleZijlstra commented on May 28, 2024

I would suggest alternative 2.

Black's philosophy is to minimize formatting options so that formatted code looks consistent and users don't have to worry about formatting minutiae. When I first watched @ambv present about Black, I was also surprised he chose double quotes, but the choice has served us well.

from black.

sodul avatar sodul commented on May 28, 2024

@nathanneuro

My workaround has been to add black to gray (v0.10) then have gray call unify after black so that we can get the goodness of black without having to grit our teeth.

Now the issue is that black is incompatible with PEP 701 as reported in #3746, so we end up with files that are formatted in valid python 3.12 syntax but that Black is unable to parse again.

https://github.com/dizballanze/gray

So if you are not on python 3.12 yet and do not like your 2 options, I suggest you take a look at it. Some of the nice things about gray is that it calls other formatting tools such as pyupgrade and isort. Thanks to this our internal codebase has improved well in readability.

BTW I did take a look at option 1, and switching from " to ' would be rather complicated, so it is not just a matter of preference but it would require tricky changes in the codebase.

Now that I'm aware of Blue ... I might add support for it in Gray so that should fix the PEP 701 issue we have and stop using unify.

from black.

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.