redisbloom-py icon indicating copy to clipboard operation
redisbloom-py copied to clipboard

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

Open filipecosta90 opened this issue 3 years ago • 3 comments

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.

filipecosta90 avatar May 11 '21 09:05 filipecosta90

@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 avatar May 11 '21 09:05 chayim

@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"

filipecosta90 avatar May 11 '21 09:05 filipecosta90

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.

chayim avatar May 11 '21 09:05 chayim