summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-02-17 01:09:04 +0200
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-02-17 01:09:04 +0200
commitd00adfbdc7b77280f6a7c97e39cb882b853da1d8 (patch)
tree26722500b372c31cda2f8e49701fe5735171684b /doc
parentfe36ec0486cfc9aba10d8d87b0f42077ad1e78db (diff)
parent1dc09ef472a1bc0ca312c7cd8a1a3c700b510b47 (diff)
downloadpylint-d00adfbdc7b77280f6a7c97e39cb882b853da1d8.tar.gz
The HTML output accepts the `--msg-template` option.
Patch by Daniel Goldsmith. Closes issue #135.
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile2
-rw-r--r--doc/conf.py4
-rw-r--r--doc/contribute.rst6
-rw-r--r--doc/extend.rst7
-rw-r--r--doc/faq.rst43
-rw-r--r--doc/ide-integration.rst39
-rw-r--r--doc/installation.rst11
-rw-r--r--doc/make.bat190
-rw-r--r--doc/message-control.rst22
-rw-r--r--doc/options.rst21
-rw-r--r--doc/output.rst2
-rw-r--r--doc/release.txt23
-rw-r--r--doc/run.rst54
13 files changed, 325 insertions, 99 deletions
diff --git a/doc/Makefile b/doc/Makefile
index 98076a6..d483f63 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -12,7 +12,7 @@ PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest all
help:
@echo "Please use \`make <target>' where <target> is one of"
diff --git a/doc/conf.py b/doc/conf.py
index b4b8fbd..d89693e 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -48,9 +48,9 @@ copyright = u'2013-2014, Logilab and contributors'
# built documents.
#
# The short X.Y version.
-version = '1.1.0'
+from pylint.__pkginfo__ import version
# The full version, including alpha/beta/rc tags.
-release = '1.1.0'
+release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/doc/contribute.rst b/doc/contribute.rst
index 6a45dea..43e5dfb 100644
--- a/doc/contribute.rst
+++ b/doc/contribute.rst
@@ -47,7 +47,7 @@ http://lists.logilab.org/pipermail/python-projects/
Forge
-----
-Pylint is developped using the mercurial_ distributed version control system.
+Pylint is developed using the mercurial_ distributed version control system.
You can clone Pylint and its dependencies from ::
@@ -64,7 +64,7 @@ your patch gets accepted.
- Pylint keeps a set of unit tests in the /test directory. The
`test_func.py` module uses external files to have some kind of easy
- functionnal testing. To get your patch accepted you must write (or change)
+ functional testing. To get your patch accepted you must write (or change)
a test input file in the `test/input` directory and message file in the
`test/messages` directory. Then run `python test_func.py` to ensure that
your test is green.
@@ -117,7 +117,7 @@ without installing them. You can run all the unit tests like so::
The -S flag keeps distutils from interfering with sys.path. YMMV.
-Adding new functionnal tests
+Adding new functional tests
----------------------------
Pylint comes with an easy way to write functional tests for new checks:
diff --git a/doc/extend.rst b/doc/extend.rst
index 476c994..b767852 100644
--- a/doc/extend.rst
+++ b/doc/extend.rst
@@ -8,7 +8,8 @@ You can find some simple examples in the examples
directory of the distribution (custom.py and custom_raw.py). I'll try to
quickly explain the essentials here.
-First, there are two kinds of checkers :
+First, there are two kinds of checkers:
+
* raw checkers, which are analysing each module as a raw file stream
* ast checkers, which are working on an ast representation of the module
@@ -25,8 +26,8 @@ Checkers are ordered by priority. For each module, Pylint's engine:
1. give the module source file as a stream to raw checkers
2. get an ast representation for the module
-3. make a depth first descent of the tree, calling visit_<> on each AST
- checker when entering a node, and living_<> on the back traversal
+3. make a depth first descent of the tree, calling ``visit_<>`` on each AST
+ checker when entering a node, and ``leave_<>`` on the back traversal
Notice that the source code is probably the best source of
documentation, it should be clear and well documented. Don't hesitate to
diff --git a/doc/faq.rst b/doc/faq.rst
index e3cd73e..a42080e 100644
--- a/doc/faq.rst
+++ b/doc/faq.rst
@@ -1,5 +1,7 @@
.. -*- coding: utf-8 -*-
+.. _faq:
+
==========================
Frequently Asked Questions
==========================
@@ -65,11 +67,23 @@ Pylint from the repository, simply invoke ::
-----------------------------------
Pylint requires the latest `astroid`_ and `logilab-common`_ packages. It should be
-compatible with any Python version greater than 2.5.0.
+compatible with any Python version greater than 2.7.0.
.. _`astroid`: https://bitbucket.org/logilab/astroid
.. _`logilab-common`: http://www.logilab.org/project/logilab-common
+2.4 What versions of Python is Pylint supporting?
+--------------------------------------------------
+
+Since Pylint 1.4, we support only Python 2.7+ and Python 3.3+.
+Using this strategy really helps in maintaining a code base compatible
+with both versions and from this benefits not only the maintainers,
+but the end users as well, because it's easier to add and test
+new features.
+If support for Python 2.6 is absolutely required, then the version
+from pylint-1.3 branch can be used. It will receive backports of
+bug fixes for a while.
+
3. Running Pylint
=================
@@ -169,7 +183,6 @@ No, starting from 0.25.3, you can use symbolic names for messages::
# pylint: disable=fixme, line-too-long
-You can show these symbols in the output with the `-sy` option.
4.5 I have a callback function where I have no control over received arguments. How do I avoid getting unused argument warnings?
----------------------------------------------------------------------------------------------------------------------------------
@@ -192,30 +205,6 @@ tricks like: ::
method-hidden,
too-many-lines
-4.7 Why do I get a lot of spurious "unused variables messages" when using psyobj from psyco_?
-----------------------------------------------------------------------------------------------
-
-This is actually due to a bug in psyco, making the locals()
-function for objects inheriting from *psyobj* returning an empty
-dictionary. For the moment, the only way to fix this is to use the
-PYLINT_IMPORT environment variable to not use psyco during Pylint
-checking. Sample code ::
-
- import os
- try:
- if os.environ.has_key('PYLINT_IMPORT'):
- raise ImportError()
- from psyco.classes import psyobj
- except ImportError:
- class psyobj:
- pass
-
-NOTICE: this problem should not occur with Pylint >= 0.5 since from
-this version Pylint is not looking anymore for information in living
-objects (i.e. it no longer imports analysed modules)
-
-.. _psyco: http://psyco.sf.net
-
5. Classes and Inheritance
==========================
@@ -259,7 +248,7 @@ lower bound on it. By default, the formula to calculate score is ::
10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
However, this option can be changed in the Pylint rc file. If having negative
-values really bugs you, you can set the formula to be the minimum of 0 and the
+values really bugs you, you can set the formula to be the maximum of 0 and the
above expression.
diff --git a/doc/ide-integration.rst b/doc/ide-integration.rst
index de5116c..30b48e5 100644
--- a/doc/ide-integration.rst
+++ b/doc/ide-integration.rst
@@ -3,35 +3,33 @@
IDE integration
=================
-To use Pylint with Emacs, see http://www.emacswiki.org/emacs/PythonProgrammingInEmacs#toc8
+To use Pylint with:
-To use Pylint with Vim, see
-http://www.vim.org/scripts/script.php?script_id=891
+ - Emacs_, see http://www.emacswiki.org/emacs/PythonProgrammingInEmacs#toc8,
+ - Vim_, see http://www.vim.org/scripts/script.php?script_id=891,
+ - Eclipse_ and PyDev_, see http://pydev.org/manual_adv_pylint.html,
+ - Komodo_, see http://mateusz.loskot.net/posts/2006/01/15/running-pylint-from-komodo/,
+ - gedit_, see https://launchpad.net/gedit-pylint-2 or https://wiki.gnome.org/Apps/Gedit/PylintPlugin,
+ - WingIDE_, see http://www.wingware.com/doc/edit/pylint,
+ - PyCharm_, see http://blog.saturnlaboratories.co.za/archive/2012/09/10/running-pylint-pycharm.
-To use Pylint with Eclipse, see http://pydev.org
+Pylint is integrated in:
-To use Pylint with Komodo_, see
-http://mateusz.loskot.net/2006/01/15/running-pylint-from-komodo/
-
-To use Pylint with gedit_, see
-http://live.gnome.org/Gedit/PylintPlugin
-
-To use Pylint with WingIDE_, see
-http://www.wingware.com/doc/edit/pylint
-
-Pylint is integrated in Eric_ IDE, see the `Project > Check` menu.
-
-Pylint is integrated in Spyder_, see http://packages.python.org/spyder/pylint.html
-
-Pylint is integrated in pyscripter_, see the `Tool -> Tools` menu.
+ - Eric_ IDE, see the `Project > Check` menu,
+ - Spyder_, see http://packages.python.org/spyder/pylint.html,
+ - pyscripter_, see the `Tool -> Tools` menu.
+.. _Emacs: http://www.gnu.org/software/emacs/
+.. _Vim: http://www.vim.org/
+.. _Eclipse: https://www.eclipse.org/
.. _Eric: http://eric-ide.python-projects.org/
.. _pyscripter: http://code.google.com/p/pyscripter/
.. _pydev: http://pydev.org
.. _Komodo: http://www.activestate.com/Products/Komodo/
-.. _gedit: http://www.gnome.org/projects/gedit/
+.. _gedit: https://wiki.gnome.org/Apps/Gedit
.. _WingIDE: http://www.wingware.com/
.. _spyder: http://code.google.com/p/spyderlib/
+.. _PyCharm: http://www.jetbrains.com/pycharm/
Using Pylint thru flymake in Emacs
==================================
@@ -41,7 +39,6 @@ To enable flymake for Python, insert the following into your .emacs:
.. sourcecode:: common-lisp
;; Configure flymake for Python
- (setq pylint "epylint")
(when (load "flymake" t)
(defun flymake-pylint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
@@ -49,7 +46,7 @@ To enable flymake for Python, insert the following into your .emacs:
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
- (list (expand-file-name pylint "") (list local-file))))
+ (list "epylint" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pylint-init)))
diff --git a/doc/installation.rst b/doc/installation.rst
index 5992bfc..eca0fa3 100644
--- a/doc/installation.rst
+++ b/doc/installation.rst
@@ -1,4 +1,3 @@
-
Installation
------------
@@ -6,7 +5,7 @@ Dependencies
''''''''''''
Pylint requires the latest `astroid`_ and `logilab-common`_
-packages. It should be compatible with any Python version >= 2.5.
+packages. It should be compatible with any Python version >= 2.7.
.. _`astroid`: https://bitbucket.org/logilab/astroid
.. _`logilab-common`: http://www.logilab.org/project/logilab-common
@@ -63,16 +62,16 @@ On Windows, once you have installed Pylint, the command line usage is ::
pylint.bat [options] module_or_package
But this will only work if *pylint.bat* is either in the current
-directory, or on your system path. (*setup.py* install install *python.bat*
+directory, or on your system path. (*setup.py* will install *python.bat*
to the *Scripts* subdirectory of your Python installation -- e.g.
C:\Python24\Scripts.) You can do any of the following to solve this:
-1. change to the appropriate directory before running pylint.bat
+1. Change to the appropriate directory before running pylint.bat
-2. add the Scripts directory to your path statement in your autoexec.bat
+2. Add the Scripts directory to your path statement in your autoexec.bat
file (this file is found in the root directory of your boot-drive)
-3. create a 'redirect' batch file in a directory actually on your
+3. Create a 'redirect' batch file in a directory actually on your
systems path
To effect (2), simply append the appropriate directory name to the PATH=
diff --git a/doc/make.bat b/doc/make.bat
new file mode 100644
index 0000000..9482679
--- /dev/null
+++ b/doc/make.bat
@@ -0,0 +1,190 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+ set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=_build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
+set I18NSPHINXOPTS=%SPHINXOPTS% .
+if NOT "%PAPER%" == "" (
+ set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+ set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+ :help
+ echo.Please use `make ^<target^>` where ^<target^> is one of
+ echo. html to make standalone HTML files
+ echo. dirhtml to make HTML files named index.html in directories
+ echo. singlehtml to make a single large HTML file
+ echo. pickle to make pickle files
+ echo. json to make JSON files
+ echo. htmlhelp to make HTML files and a HTML help project
+ echo. qthelp to make HTML files and a qthelp project
+ echo. devhelp to make HTML files and a Devhelp project
+ echo. epub to make an epub
+ echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+ echo. text to make text files
+ echo. man to make manual pages
+ echo. texinfo to make Texinfo files
+ echo. gettext to make PO message catalogs
+ echo. changes to make an overview over all changed/added/deprecated items
+ echo. linkcheck to check all external links for integrity
+ echo. doctest to run all doctests embedded in the documentation if enabled
+ goto end
+)
+
+if "%1" == "clean" (
+ for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+ del /q /s %BUILDDIR%\*
+ goto end
+)
+
+if "%1" == "html" (
+ %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+ goto end
+)
+
+if "%1" == "dirhtml" (
+ %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+ goto end
+)
+
+if "%1" == "singlehtml" (
+ %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+ goto end
+)
+
+if "%1" == "pickle" (
+ %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can process the pickle files.
+ goto end
+)
+
+if "%1" == "json" (
+ %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can process the JSON files.
+ goto end
+)
+
+if "%1" == "htmlhelp" (
+ %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+ goto end
+)
+
+if "%1" == "qthelp" (
+ %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+ echo.^> qcollectiongenerator %BUILDDIR%\qthelp\a.qhcp
+ echo.To view the help file:
+ echo.^> assistant -collectionFile %BUILDDIR%\qthelp\a.ghc
+ goto end
+)
+
+if "%1" == "devhelp" (
+ %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished.
+ goto end
+)
+
+if "%1" == "epub" (
+ %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The epub file is in %BUILDDIR%/epub.
+ goto end
+)
+
+if "%1" == "latex" (
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+ goto end
+)
+
+if "%1" == "text" (
+ %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The text files are in %BUILDDIR%/text.
+ goto end
+)
+
+if "%1" == "man" (
+ %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The manual pages are in %BUILDDIR%/man.
+ goto end
+)
+
+if "%1" == "texinfo" (
+ %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
+ goto end
+)
+
+if "%1" == "gettext" (
+ %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
+ goto end
+)
+
+if "%1" == "changes" (
+ %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.The overview file is in %BUILDDIR%/changes.
+ goto end
+)
+
+if "%1" == "linkcheck" (
+ %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+ goto end
+)
+
+if "%1" == "doctest" (
+ %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+ goto end
+)
+
+:end
diff --git a/doc/message-control.rst b/doc/message-control.rst
index d93b452..203229d 100644
--- a/doc/message-control.rst
+++ b/doc/message-control.rst
@@ -22,34 +22,34 @@ An example available from the examples directory:
def meth2(self, arg):
"""and this one not"""
- # pylint: disable=W0613
+ # pylint: disable=unused-argument
print self\
+ "foo"
def meth3(self):
"""test one line disabling"""
# no error
- print self.bla # pylint: disable=E1101
+ print self.bla # pylint: disable=no-member
# error
print self.blop
def meth4(self):
"""test re-enabling"""
- # pylint: disable=E1101
+ # pylint: disable=no-member
# no error
print self.bla
print self.blop
- # pylint: enable=E1101
+ # pylint: enable=no-member
# error
print self.blip
def meth5(self):
"""test IF sub-block re-enabling"""
- # pylint: disable=E1101
+ # pylint: disable=no-member
# no error
print self.bla
if self.blop:
- # pylint: enable=E1101
+ # pylint: enable=no-member
# error
print self.blip
else:
@@ -60,14 +60,14 @@ An example available from the examples directory:
def meth6(self):
"""test TRY/EXCEPT sub-block re-enabling"""
- # pylint: disable=E1101
+ # pylint: disable=no-member
# no error
print self.bla
try:
- pylint: enable=E1101
+ # pylint: enable=no-member
# error
print self.blip
- except UndefinedName: # pylint: disable=E0602
+ except UndefinedName: # pylint: disable=undefined-variable
# no error
print self.blip
# no error
@@ -75,7 +75,7 @@ An example available from the examples directory:
def meth7(self):
"""test one line block opening disabling"""
- if self.blop: # pylint: disable=E1101
+ if self.blop: # pylint: disable=no-member
# error
print self.blip
else:
@@ -89,7 +89,7 @@ An example available from the examples directory:
"""test late disabling"""
# error
print self.blip
- # pylint: disable=E1101
+ # pylint: disable=no-member
# no error
print self.bla
print self.blop
diff --git a/doc/options.rst b/doc/options.rst
index 4a159f2..d005dd2 100644
--- a/doc/options.rst
+++ b/doc/options.rst
@@ -1,13 +1,13 @@
.. -*- coding: utf-8 -*-
===============
- Configuration
+ Configuration
===============
Naming Styles
-------------
-PyLint recognizes a number of different name types internally. With a few
+Pylint recognizes a number of different name types internally. With a few
exceptions, the type of the name is governed by the location the assignment to a
name is found in, and not the type of object assigned.
@@ -88,11 +88,11 @@ Large code bases that have been worked on for multiple years often exhibit an
evolution in style as well. In some cases, modules can be in the same package,
but still have different naming style based on the stratum they belong to.
However, intra-module consistency should still be required, to make changes
-inside a single file easier. For this case, PyLint supports regular expression
-with several named capturing group.
+inside a single file easier. For this case, Pylint supports regular expression
+with several named capturing group.
-The capturing group of the first valid match taints the module and enforces the
-same group to be triggered on every subsequent occurrence of this name.
+Rather than emitting name warnings immediately, Pylint will determine the
+prevalent naming style inside each module and enforce it on all names.
Consider the following (simplified) example::
@@ -101,16 +101,17 @@ Consider the following (simplified) example::
The regular expression defines two naming styles, ``snake`` for snake-case
names, and ``camel`` for camel-case names.
-In ``sample.py``, the function name on line 1 will taint the module and enforce
-the match of named group ``snake`` for the remainder of the module::
+In ``sample.py``, the function name on line 1 and 7 will mark the module
+and enforce the match of named group ``snake`` for the remaining names in
+the module::
- def trigger_snake_case(arg):
+ def valid_snake_case(arg):
...
def InvalidCamelCase(arg):
...
- def valid_snake_case(arg):
+ def more_valid_snake_case(arg):
...
Because of this, the name on line 4 will trigger an ``invalid-name`` warning,
diff --git a/doc/output.rst b/doc/output.rst
index 47d29c0..389becd 100644
--- a/doc/output.rst
+++ b/doc/output.rst
@@ -33,7 +33,7 @@ C
category
fullname of the message category
-For exemple the former (pre 1.0) default format can be obtained with::
+For example, the former (pre 1.0) default format can be obtained with::
pylint --msg-template='{msg_id}:{line:3d},{column}: {obj}: {msg}'
diff --git a/doc/release.txt b/doc/release.txt
new file mode 100644
index 0000000..96d4186
--- /dev/null
+++ b/doc/release.txt
@@ -0,0 +1,23 @@
+Release Process
+===============
+
+1. Preparation
+ 1. Check if the dependencies of the package are correct
+ 2. Update the version number in __pkginfo__
+ 3. Put the version number and the release date into the changelog
+ 4. Submit your changes.
+
+2. Make sure the tests are passing on drone.io:
+ https://drone.io/bitbucket.org/logilab/pylint
+
+3. Add a new tag 'pylint-$VERSION'
+
+5. Publish all remaining changes to the Bitbucket repository:
+ https://bitbucket.org/logilab/pylint
+
+4. Run
+
+ $ python setup.py register sdist --formats=gztar bdist_wheel upload
+
+ to release a new version to PyPI.
+ \ No newline at end of file
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).