summaryrefslogtreecommitdiff
path: root/doc/run.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/run.rst')
-rw-r--r--doc/run.rst54
1 files changed, 40 insertions, 14 deletions
diff --git a/doc/run.rst b/doc/run.rst
index 4e752b0..85db098 100644
--- a/doc/run.rst
+++ b/doc/run.rst
@@ -10,9 +10,11 @@ Pylint is meant to be called from the command line. The usage is ::
pylint [options] module_or_package
You should give Pylint the name of a python package or module. Pylint
-will ``import`` this package or module, so you should pay attention to
-your ``PYTHONPATH``, since it is a common error to analyze an
-installed version of a module instead of the development version.
+``will not import`` this package or module, though uses Python internals
+to locate them and as such is subject to the same rules and configuration.
+You should pay attention to your ``PYTHONPATH``, since it is a common error
+to analyze an installed version of a module instead of the
+development version.
It is also possible to analyze python files, with a few
restrictions. The thing to keep in mind is that Pylint will try to
@@ -29,9 +31,9 @@ directory is automatically added on top of the python path ::
will work if "directory" is a python package (i.e. has an __init__.py
file) or if "directory" is in the python path.
-For more details on this see the Frequently Asked Questions.
+For more details on this see the :ref:`faq`.
-You can also start a thin gui around Pylint (require TkInter) by
+You can also start a thin gui around Pylint (require tkinter) by
typing ::
pylint-gui
@@ -41,7 +43,7 @@ or module to check, at Pylint messages will be displayed in the user
interface.
It is also possible to call Pylint from an other python program,
-thanks to ``py_run()`` function in ``lint`` module,
+thanks to ``py_run()`` function in ``epylint`` module,
assuming Pylint options are stored in ``pylint_options`` string, as:
.. sourcecode:: python
@@ -50,12 +52,12 @@ assuming Pylint options are stored in ``pylint_options`` string, as:
lint.py_run(pylint_options)
To silently run Pylint on a ``module_name.py`` module,
-and get its standart output and error:
+and get its standard output and error:
.. sourcecode:: python
from pylint import epylint as lint
- (pylint_stdout, pylint_stderr) = lint.py_run('module_name.py', True)
+ (pylint_stdout, pylint_stderr) = lint.py_run('module_name.py', return_std=True)
Command line options
@@ -88,7 +90,7 @@ expression in special cases). For a full list of options, use ``--help``
Specifying all the options suitable for your setup and coding
standards can be tedious, so it is possible to use a configuration file to
-specify the default values. You can specify a configuration file on the
+specify the default values. You can specify a configuration file on the
command line using the ``--rcfile`` option. Otherwise, Pylint searches for a
configuration file in the following order and uses the first one it finds:
@@ -104,7 +106,6 @@ configuration file in the following order and uses the first one it finds:
#. ``.pylintrc`` in your home directory
#. ``.config/pylintrc`` in your home directory
- else, ``.pylintrc`` in the current working directory
#. ``/etc/pylintrc``
The ``--generate-rcfile`` option will generate a commented configuration file
@@ -115,16 +116,41 @@ includes:
* Options appearing before ``--generate-rcfile`` on the Pylint command line
Of course you can also start with the default values and hand tune the
-configuration.
+configuration.
Other useful global options include:
---ignore=file Add <file> (may be a directory) to the black
+--ignore=<file[,file]> Add <file> (may be a directory) to the black
list. It should be a base name, not a path.
- You may set this option multiple times.
+ Multiple entries can be given, separated by
+ comma.
--persistent=y_or_n Pickle collected data for later comparisons.
--output-format=<format> Select output format (text, html, custom).
--msg-template=<template> Modifiy text output message template.
--list-msgs Generate pylint's messages.
---full-documentation Generate pylint's full documentation, in reST
+--full-documentation Generate pylint's full documentation, in reST
format.
+
+Parallel execution
+------------------
+
+It is possible to speed up the execution of Pylint. If the running computer
+has more CPUs than one, then the files to be checked could be spread on all
+processors to Pylint sub-processes.
+This functionality is exposed via ``-j`` command line parameter.
+It takes a number of sub-processes that should be spawned.
+If the provided number is 0 then the number of CPUs will be used.
+The default number of workers is 1.
+
+Example::
+
+ pylint -j 4 mymodule1.py mymodule2.py mymodule3.py mymodule4.py
+
+This will spawn 4 parallel Pylint sub-process, where each provided module will
+be checked in parallel. Discovered problems by checkers are not displayed
+immediately. They are shown just after completing checking a module.
+
+There are some limitations in running checks in parallel in current
+implementation. It is not possible to use custom plugins
+(i.e. ``--load-plugins`` option), nor it is not possible to use
+initialization hooks (i.e. ``--init-hook`` option).