I do not understand why pylint takes about 5 minutes to check my code, where pep8 takes only 1 sec.
I use Mac and I have pylint 1.8.4
installed through conda install -c conda-forge pylint
. Pylint is very slow either I use Terminal or the Spyder editor. I tried creating a config file .pylintrc
but it didn't make a difference to the speed.
How can I accelerate the Pylint speed? Thank you.
Pylint is a great linter, but it can be horrendously slow to run on anything but the most trivial of code bases. While there are a multitude of configuration options that can be tweaked, the simplest approach is to only lint files that you have edited.
Pylint is a python linter which checks the source code and also acts as a bug and quality checker. It has more verification checks and options than just PEP8(Python style guide). This is the most commonly used tool for linting in python.
Pylint analyses your code without actually running it. It checks for errors, enforces a coding standard, looks for code smells, and can make suggestions about how the code could be refactored. Pylint can infer actual values from your code using its internal code representation (astroid).
You can speed up pylint
by spawning multiple processes and checking files in parallel. This functionality is exposed via the -j
command-line parameter. If the provided number is 0
, then the total number of CPUs will be autodetected and used. From the output of pylint --help
:
-j <n-processes>, --jobs=<n-processes>
Use multiple processes to speed up Pylint. Specifying
0 will auto-detect the number of processors available
to use. [current: 1]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With