top | item 34062907

(no title)

kuu | 3 years ago

> Black formats things differently depending on the version.

Then add black as part of your environment with an specific version...

discuss

order

bombolo|3 years ago

Or wait until a more sensible formatting tool comes along.

Reformatting the whole code every version isn't so good. It's also very slow.

fnord123|3 years ago

Install pre-commit: https://pre-commit.com/

Set black up in the pre-commit with a specific version. When you make a commit it will black the files being committed using the specific version of black. As it's a subset, it's fast. As it's a specific version, it's not going back and forth.

I hope this solves your issues.

wodenokoto|3 years ago

That would only make it more likely that two developers would be using two different versions of Black.

The further you get away from the project folder the more likely each developer is to have a different environment.

adammarples|3 years ago

Just put a versioned black into pre-commit yaml and put that in your source and forget about it

bombolo|3 years ago

I'm sure you will get many contributions to your project if you refuse people with the wrong distribution from contributing.

biorach|3 years ago

I think by now it's a reasonable requirement for contributors to use a virtualenv when working on a project