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

format and check the style of Python code in PEP8 compliant manner #26

Open
filipecosta90 opened this issue May 11, 2021 · 3 comments
Open
Labels
help wanted x:quality Code-Quality related (performance, test, etc. -not directly affecting functionality)

Comments

@filipecosta90
Copy link

Blackened code looks the same regardless of the project and this is why I believe we should format and check for black style on commits.

@chayim
Copy link
Contributor

chayim commented May 11, 2021

@filipecosta90 Black and yapf aren't the most stable. I'm more a fan of pep8, flake8, pyflakes, mccabe enforcement. You can wire them up to repo hooks locally if you want (that's what I do for pre-commit triggers in python repos).

The advantage is they don't rewrite your source code. The disadvantage is that they don't rewrite yours source code.

@filipecosta90 filipecosta90 changed the title format and check the style of Python code with black format and check the style of Python code in PEP8 compliant manner May 11, 2021
@filipecosta90
Copy link
Author

@filipecosta90 Black and yapf aren't the most stable. I'm more a fan of pep8, flake8, pyflakes, mccabe enforcement. You can wire them up to repo hooks locally if you want (that's what I do for pre-commit triggers in python repos).

The advantage is they don't rewrite your source code. The disadvantage is that they don't rewrite yours source code.

@chayim with regards to format stability do you think that is a "real" issue? docs :

Black is a PEP 8 compliant opinionated formatter. Black reformats entire files in place. Style configuration options are deliberately limited and rarely added.

Noneteless as long as we enforce some format I'm 100% in agreement. I've changed the name of the issue to: "format and check the style of Python code in PEP8 compliant manner"

@chayim
Copy link
Contributor

chayim commented May 11, 2021

Absolutely. I'm pro format checks, I don't care which. The benefit of McCabe and friends is that you can also get cyclometric conplexity checks. But again, any formatter.

@filipecosta90 filipecosta90 added help wanted x:quality Code-Quality related (performance, test, etc. -not directly affecting functionality) labels May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted x:quality Code-Quality related (performance, test, etc. -not directly affecting functionality)
Projects
None yet
Development

No branches or pull requests

2 participants