I personally use a GIT commit hook which runs flake8 against the *modified py files only* and rejects the commit in case of non-compliance: https://github.com/giampaolo/psutil/blob/master/.git-pre-commit ...I install it via make: https://github.com/giampaolo/psutil/blob/ad4acae5489f86fc3bef645505b3873f156b4867/Makefile#L186 ...and once the whole code base is in a good shape have Travis run flake8 against the whole code base on each commit.
When I join an existing project I try to enforce the same workflow and rely on pep8ify (https://github.com/spulec/pep8ify) to adjust the existing code. In order to not be too "strict" I may modify the GIT hook to emit a warning instead of rejecting the commit. On one hand I think it would be great to do the same for cPython. On the other hand I see 2 big downsides: - losing "git blame" history for A LOT of lines of code - even if you're familiar with PEP8 it's sometimes hard to spot non-compliant lines unless you integrate flake8 into your IDE (I do for Sublime); putting such a constraint on contributing users is probably too much and may discourage contributions. On Sun, Feb 25, 2018 at 6:13 AM, Guido van Rossum <gu...@python.org> wrote: > It's easy to only analyze the files in the diff (these linters don't do > cross-file analysis anyways, typically) and it's possible to write a filter > that only keeps warnings about lines that are changed, but I don't know of > a standard solution for the latter (places where I worked where I've seen > this always had their own custom implementation). > > On Sat, Feb 24, 2018 at 7:35 PM, Mariatta Wijaya < > mariatta.wij...@gmail.com> wrote: > >> Can any of these said linters analyze only the diff in the PR, instead of >> the entire CPython codebase? >> >> Mariatta Wijaya >> >> ᐧ >> >> _______________________________________________ >> Python-Dev mailing list >> Python-Dev@python.org >> https://mail.python.org/mailman/listinfo/python-dev >> Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido% >> 40python.org >> >> > > > -- > --Guido van Rossum (python.org/~guido) > > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/g. > rodola%40gmail.com > > -- Giampaolo - http://grodola.blogspot.com
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com