After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790514 - [PATCH] python: improve performance of the pep8 check
[PATCH] python: improve performance of the pep8 check
Status: RESOLVED FIXED
Product: gnome-code-assistance
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Code Assistance maintainers
GNOME Code Assistance maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-17 20:07 UTC by Elad Alfassa
Modified: 2017-11-17 21:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] python: improve performance of the pep8 check (5.94 KB, patch)
2017-11-17 20:07 UTC, Elad Alfassa
accepted-commit_now Details | Review

Description Elad Alfassa 2017-11-17 20:07:59 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.
Comment 1 Ignacio Casal Quinteiro (nacho) 2017-11-17 20:59:18 UTC
Review of attachment 363949 [details] [review]:

Fine for me