5
A simple program which checks Python source files for errors.
7
Pyflakes analyzes programs and detects various errors. It works by
8
parsing the source file, not importing it, so it is safe to use on
9
modules with side effects. It's also much faster.
11
It is `available on PyPI <https://pypi.python.org/pypi/pyflakes>`_
12
and it supports all active versions of Python from 2.5 to 3.5.
19
It can be installed with::
21
$ pip install --upgrade pyflakes
26
* Be sure to install it for a version of Python which is compatible
27
with your codebase: for Python 2, ``pip2 install pyflakes`` and for
28
Python3, ``pip3 install pyflakes``.
30
* You can also invoke Pyflakes with ``python3 -m pyflakes .`` or
31
``python2 -m pyflakes .`` if you have it installed for both versions.
33
* If you require more options and more flexibility, you could give a
39
Pyflakes makes a simple promise: it will never complain about style,
40
and it will try very, very hard to never emit false positives.
42
Pyflakes is also faster than Pylint_
43
or Pychecker_. This is
44
largely because Pyflakes only examines the syntax tree of each file
45
individually. As a consequence, Pyflakes is more limited in the
46
types of things it can check.
48
If you like Pyflakes but also want stylistic checks, you want
49
flake8_, which combines
50
Pyflakes with style checks against
52
per-project configuration ability.
58
Share your feedback and ideas: `subscribe to the mailing-list
59
<https://mail.python.org/mailman/listinfo/code-quality>`_
64
Issues are tracked on `Launchpad <https://bugs.launchpad.net/pyflakes>`_.
66
Patches may be submitted via a `GitHub pull request`_ or via the mailing list
67
if you prefer. If you are comfortable doing so, please `rebase your changes`_
68
so they may be applied to master with a fast-forward merge, and each commit is
69
a coherent unit of work with a well-written log message. If you are not
70
comfortable with this rebase workflow, the project maintainers will be happy to
71
rebase your commits for you.
73
All changes should be include tests and pass flake8_.
75
.. image:: https://api.travis-ci.org/pyflakes/pyflakes.png
76
:target: https://travis-ci.org/pyflakes/pyflakes
79
.. _Pylint: http://www.pylint.org/
80
.. _flake8: https://pypi.python.org/pypi/flake8
81
.. _`PEP 8`: http://legacy.python.org/dev/peps/pep-0008/
82
.. _Pychecker: http://pychecker.sourceforge.net/
83
.. _`rebase your changes`: https://git-scm.com/book/en/v2/Git-Branching-Rebasing
84
.. _`GitHub pull request`: https://github.com/pyflakes/pyflakes/pulls