-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid doing a regex search for line lengths unless necessary
Before this change, we would check a line for pylint: disable-style pragmas to determine whether to check the line length. The regex check itself is very costly (~5% of pylint's total runtime in one codebase), and is much more costly than the check itself. This refactors the pylint check to instead do an approximate line length check on everything, before using the regex to handle exceptional, false negative cases like pragmas being the cause for the line length overflow. This change, in one sample codebase, lowered the check_lines runtime from 5% of the total runtime to 0.35% of the total runtime
- Loading branch information
1 parent
e9b4f05
commit 9a5e1b3
Showing
3 changed files
with
16 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters