getavalon / core

The safe post-production pipeline - https://getavalon.github.io/2.0
MIT License
213 stars 48 forks source link

Add config for Black or disable the 'Black check' for Hound CI #506

Closed jasperges closed 4 years ago

jasperges commented 4 years ago

It seems Hound CI recently (see for example this question by @BigRoy) started to check the code with Black. The only output you get from the Hound is "Black would make changes." So it seems it runs black --check on your code.

If this check is wanted, I would suggest to add a config for Black in the repository, unless the default options are totally fine. To add specific config parameters a pyproject.toml file has to be added with configuration options for Black. As @davidlatwe mentioned here the default values seem to conflict with PEP8. That is something that could probably be fixed in the config.

How do people feel about this?

davidlatwe commented 4 years ago

Add an example for what's conflicting with PEP8 in my IDE (was using SublimeText + sublack):

# original code
name = knob.name()[len(TEMP):]
# Everything's fine
# black formatted
name = knob.name()[len(TEMP) :]
# And my linter highlighted this line and says: "PEP 8 (E203): whitespace before ':' "
davidlatwe commented 4 years ago

I don't like Black. :angry:

jasperges commented 4 years ago
# black formatted
name = knob.name()[len(TEMP) :]

That is really stupid.

I also just noticed that the default line length is 88 (???). As discussed here it will be 80 for Avalon (strictly following PEP8).

It also wants me to change ' to ". I really don't like that to be forced...

tokejepsen commented 4 years ago

Voting for disabling Black.

jasperges commented 4 years ago

Just noticed this:

It is not configurable.

It does have support for YAPF block comments, but it is really ugly to litter your code with them.

I strongly vote for disabling Black.

davidlatwe commented 4 years ago

Just found this comment about whitespace before ":" :point_right: here

So... the one that is wrong, was my linter which using Flake8...

But even Black is correct on PEP 8, changing the style just to be on the right style side seems unnecessary. :/

Voting for stick with PEP8 + Flake8, disabling Black. :+1:

BigRoy commented 4 years ago

👍 - Let's put our new Hound to sleep and revive old black-less Hound. 🐩