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

Suggestion: switch to black code formatter #997

Closed
gonzalocasas opened this issue Mar 5, 2022 · 4 comments
Closed

Suggestion: switch to black code formatter #997

gonzalocasas opened this issue Mar 5, 2022 · 4 comments

Comments

@gonzalocasas
Copy link
Member

Considering the prominence of black (https://github.com/psf/black) as the increasingly de-facto standard for code formatting on Python, it might be a good idea to switch to it and give up all hand-crafted control of code style in favor of total consistency.

Reasons to use black:

  • Our code is mostly black compatible already. I tried locally, and by far, the largest change is the consistent update of all string quotes to be double quoted.
  • Consistency, consistency, consistency. More and more big (and small) projects use it, and the lack of configurability means all projects are styled consistency even across organizations.
  • When working with code, you don't even have think about formatting, it will be done entirely for you. If you're an experienced coder, this is good because you can focus on what matters, if you are a novice coder, it's also good because it removes a whole category of review comments that need to be addressed later on.
  • It's not configurable: you can have any color you want, as long as it's black.
  • It's called black!

Reasons not to use black:

@tomvanmele
Copy link
Member

sure but perhaps this can be part of COMPAS 2.0?

@gonzalocasas
Copy link
Member Author

👍

@jf---
Copy link
Contributor

jf--- commented Apr 8, 2024

OCD ;)

😂

@gonzalocasas this in integrated in the CI.
see #1208 for the suggesion of invoke black as per pre-commit

@gonzalocasas
Copy link
Member Author

black is already integrated, and we have #1329 for the pre-commit hook

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

No branches or pull requests

3 participants