You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refine PEP8 standards for TravisCI and git pre-commit hook #883
Issue #840 (via pull request #877) added pep8 checks to TravisCI, issue #493 describes a git pre-commit hook to enforce pep8 style guidelines.
Currently the TravisCI setup applies different pep8 strictness to the top level folders (out of practicality), but medium term we should try to agree on and fix remaining issues in order to have a single strictly enforced set of pep8 checks. I would suggest having the git pre-commit hook being even stricter (but optionally enforced).
As suggested by @bow on #840, we could then record these settings in a setup.cfg or .pep8 file which would be used by most of the PEP8 testing tools (including local testing and some editors).
This isn't exactly the refined PEP8 standard we are aiming for, but what do you think about moving the per-directory style settings out of the .travis-tox.ini file and into separate config in the respective directories (i.e. something like this)?
Would this have any downside compared to the current setup that I may be missing? The upside is that now some editors can read and apply the style checks on the fly already :).
I can apply this directly sometime later today, if that's ok.
On second look, what do you think about using setup.cfg instead of .pycodestyle in the root folder? The goal is then to gradually remove the .flake8 files in the subdirectories to have just a single [flake8] entry in the root setup.cfg (in other words, to have a single style setting for the entire Biopython).
I certainly would hope we can get to a single flake8 configuration for the whole of Biopython.
I'm a little less settled on yet another non-hidden file in the project root, but that does make sense as a longer term goal covering all the style settings.
I'm a little less settled on yet another non-hidden file in the project root, but that does make sense as a longer term goal covering all the style settings.
Ok then. I'll apply the changes here as-is to master soon.
@peterjc We can make use of Coala for the pre-commit checks in docstrings and Lint errors. It has integration with Travis, but I am not sure if it works with Tox.
@souravsingh if Coala has an easy to install git pre-commit hook, which we can configure to match our current settings (or it reads the .flake8 and .pydocstyle files etc), that might be interesting. Could you look into this please?
Coala doesn't read the .flake8 or .pydocstyle file, but it makes use of a .coafile config file to set parameters for the various bears( PEP8Bear, PyDocStyleBear etc.)
So it is simple to match what we're doing right now (i.e. copy the current ignore lists), and use coala for (1) the TravisCI style checks and (2) a git pre-commit check?
Activity
bow commentedon Mar 6, 2017
Hi @peterjc,
This isn't exactly the refined PEP8 standard we are aiming for, but what do you think about moving the per-directory style settings out of the
.travis-tox.inifile and into separate config in the respective directories (i.e. something like this)?Would this have any downside compared to the current setup that I may be missing? The upside is that now some editors can read and apply the style checks on the fly already :).
peterjc commentedon Mar 7, 2017
Good plan. 👍
Since I transitioned from the command line tool
pep8toflake8that makes a lot of sense. When we used the command line toolpep8(now renamedpycodestyle), per-folder settings did not seem to be easily possible with hidden files https://pycodestyle.readthedocs.io/en/latest/intro.html#configurationIf we need to use per-folder
. pydocstylefiles, according to http://www.pydocstyle.org/en/latest/snippets/config.html that would work too.Do you want to apply that change directly and/or make a pull request?
bow commentedon Mar 7, 2017
I can apply this directly sometime later today, if that's ok.
On second look, what do you think about using
setup.cfginstead of.pycodestylein the root folder? The goal is then to gradually remove the.flake8files in the subdirectories to have just a single[flake8]entry in the rootsetup.cfg(in other words, to have a single style setting for the entire Biopython).peterjc commentedon Mar 7, 2017
I certainly would hope we can get to a single flake8 configuration for the whole of Biopython.
I'm a little less settled on yet another non-hidden file in the project root, but that does make sense as a longer term goal covering all the style settings.
bow commentedon Mar 7, 2017
Ok then. I'll apply the changes here as-is to
mastersoon.bow commentedon Mar 7, 2017
Done in 3027734 ~
souravsingh commentedon Apr 22, 2017
@peterjc We can make use of Coala for the pre-commit checks in docstrings and Lint errors. It has integration with Travis, but I am not sure if it works with Tox.
peterjc commentedon Apr 22, 2017
@souravsingh if Coala has an easy to install git pre-commit hook, which we can configure to match our current settings (or it reads the
.flake8and.pydocstylefiles etc), that might be interesting. Could you look into this please?souravsingh commentedon Apr 22, 2017
Coala doesn't read the
.flake8or.pydocstylefile, but it makes use of a.coafileconfig file to set parameters for the various bears( PEP8Bear, PyDocStyleBear etc.)peterjc commentedon Apr 22, 2017
So it is simple to match what we're doing right now (i.e. copy the current ignore lists), and use coala for (1) the TravisCI style checks and (2) a git pre-commit check?
souravsingh commentedon Apr 22, 2017
Yes, As for a git pre-commit check, I think something like Gitmate could be handy.
peterjc commentedon May 1, 2017
As part of #1199 I've started commenting the
.flake8configuration so we can explain why we might be ignoring specific checks.peterjc commentedon May 23, 2019
I think that as of PR #2074 with a single top level
.flake8file, we can mark this issue as closed.The ignore list in the file is documented with error codes we intentionally ignore versus those we would like to enforce in future.