Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jasperges opened this issue Jan 8, 2020 · 7 comments · Fixed by #510
Closed

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

jasperges opened this issue Jan 8, 2020 · 7 comments · Fixed by #510

Comments

@jasperges
Copy link
Contributor

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
Copy link
Collaborator

davidlatwe commented Jan 8, 2020

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
Copy link
Collaborator

I don't like Black. 😠

@jasperges
Copy link
Contributor Author

jasperges commented Jan 8, 2020

# 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...

@jasperges jasperges changed the title Add config for Black (to shush the Hound) Add config for Black or disable the 'Black check' for Hound CI Jan 8, 2020
@tokejepsen
Copy link
Collaborator

Voting for disabling Black.

@jasperges
Copy link
Contributor Author

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
Copy link
Collaborator

Just found this comment about whitespace before ":" 👉 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. 👍

@BigRoy
Copy link
Collaborator

BigRoy commented Jan 8, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants