opendatateam / udata

Customizable and skinnable social platform dedicated to open data.

Home Page:http://udata.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduce pylint or black in pre-commit hook combined with pyflake8?

ThomasG77 opened this issue · comments

On contributing guide e.g https://github.com/opendatateam/udata/blob/master/CONTRIBUTING.md#python-style-guide, there is a mention about using Python style guide. When you follow the link, you find in the section of the Google Python style guide https://google.github.io/styleguide/pyguide.html#2-python-language-rules, there is a mention to Pylint

Run pylint over your code using this pylintrc.

When I run it e.g wget https://google.github.io/styleguide/pylintrc;pylint udata, I see there are numerous issues (24680)

Pylint could be combined with flake8

Alternative could be about using black + flake8 http://www.locallyoptimal.com/blog/2019/08/23/why-you-should-use-black-for-your-python-style-linting/

Reasoning borrowed from microsoft/presidio#317 and http://www.locallyoptimal.com/blog/2019/08/23/why-you-should-use-black-for-your-python-style-linting/

I do not have a personal preference as long as a Python coding style can be enforced for consistency.

Agreed with the need for better code consistency. @quaxsze, is there any history on using a pre-commit hook for linting?