banesullivan / scooby

🐶 🕵️ Great Dane turned Python environment detective
MIT License
47 stars 12 forks source link

Code style: Black? #29

Closed banesullivan closed 2 years ago

banesullivan commented 5 years ago

I'm playing around with Black and it's super easy to integrate into projects with a pre-commit hook.

@prisae - how would you feel about trying this out here? Since this project is in its infancy, it'd be much easier to start something like this

Inspired by https://github.com/pyvista/pyvista/issues/288

prisae commented 5 years ago

I personally have my strong reservation towards Black. But I would have no problem using it in this project, under the condition that we change the default line-length of black to 80.

prisae commented 5 years ago

Regarding my reservations, see https://github.com/kenneth-reitz/white

banesullivan commented 5 years ago

I personally have my strong reservation towards Black

I'd definitely be curious to hear what your reservations are - I'm considering doing something like this fo PyVista since its becoming quite a beast to provide some constancy across the API

banesullivan commented 5 years ago

Just the line length? Any other reservations?

prisae commented 5 years ago

I guess they are not strong. I simply never used it . However, the default line-length and all the arguments they have about it bothers me. There is PEP8, 80 seems to be a very common standard. And then they make it 88, given the reason of saving vertical space. However, if you do stuff like

def func(
    a=x,
    b=y,
    c=z,
)

with every parameter on a new line then the goal obviously is to minimize changes between commits (which is good), but NOT saving vertical space.

But by all means, go ahead!

prisae commented 5 years ago

So just use it with black --line-length 80 or even with black --line-length 79 and I'll be happy :-D

banesullivan commented 5 years ago

Hm... I'm going to play around with some of the other formatters first

Thanks for sharing though!

prisae commented 5 years ago

(Actually preferably with 79)