GNOME Bugzilla – Bug 790514
[PATCH] python: improve performance of the pep8 check
Last modified: 2017-11-17 21:14:54 UTC
Created attachment 363949 [details] [review] [PATCH] python: improve performance of the pep8 check This patch significantly improves performance of the pep8 checks, from ~400ms to ~30ms per run, by using pep8 directly instead of launching a subprocess. It also adds support for pycodestyle, which is the new name for the pep8 tool (since 2016), while maintaining backwards compatibility for users who still have pep8 installed. Another minor change is that it avoids running ast.parse() if pyflakes or pylint are enabled, because they'll warn about syntax errors as well. With this patch, python code assistance is much more responsive when pylint is not enabled. When pylint *is* enabled, parsing one file still takes more than a second, which is way too much for small files, so I'll be looking into improving the performance of the pylint check sometime later.
Review of attachment 363949 [details] [review]: Fine for me
Pushed as https://git.gnome.org/browse/gnome-code-assistance/commit/?id=a7326287018d3ef2bb79c8232d3daf4212c03b83