[Biopython-dev] Fwd: git pre-commit hook for PEP8 style checking

Peter Cock p.j.a.cock at googlemail.com
Mon Oct 20 17:54:02 UTC 2014


That sounds like a good approach Christian - start gently with only a
small set of PEP8 tests on the commit hook :)

What about PEP8 E501 (line too long) with its default of 78 characters,
this is really a human judgement call - and indeed PEP8 was actually
revised here:
 - https://hg.python.org/peps/rev/fb24c80e9afb
 - http://legacy.python.org/dev/peps/pep-0008/#maximum-line-length

So unless the pep8 tool E501 line length is configurable, I would not
favour including it in a standard git commit hook.

Peter

On Mon, Oct 20, 2014 at 6:32 PM, Christian Brueffer
<christian at brueffer.de> wrote:
> I also see PEP8 and docstrings as mostly seperate issues, especially since
> I'm basically done fixing the few issues that concerned them.
>
> It's true that some error classes have a high occurrence, i.e., various
> kinds of indentation issues (which are the biggest bunch currently excluded
> from the commit hook), whitespace around operators etc.
>
> What I'd like to see is do is take measures to prevent easy stuff from
> creeping back in (e.g., EOL and EOF whitespace, bad indentation ...), while
> slowly chugging away at the bigger issues.
>
> That's also why I'd like input on which rules to in/exclude in the commit
> hook.  I think it's better catch the worst offenders with buy-in from
> everyone, than to enforce everything at once and have make the
> commit process so annoying that people just add a git alias including
> --no-verify :-)
>
> Chris


More information about the Biopython-dev mailing list