Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
a faster smurfier pyflakes fork using _ast instead of compiler
Python
branch: master

This branch is 2 commits ahead, 36 commits behind dcramer:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
pyflakes
.gitignore
LICENSE
NEWS.txt
README.md
setup.py

README.md

Pyflakes: static code analysis for Python 2

Pyflakes is a tool for finding mistakes in Python code. The code being examined is never executed, so results are fast and accurate. On the other hand, this won't catch everything.

Versions supported

Python 2.5+

Credits

Pyflakes was originally written by Divmod, which no longer appears to exist. kevinw took the code and has maintained it since. This fork also takes a number of patches from dcramer.

Example

from foo import bar # unused imports

def my_function():
    x = 1 # unused variables

    return i_dont_exist() # undefined functions

Usage

From source:

$ sudo python2 setup.py install

This will place the pyflakes script on your $PATH. You can then do:

$ pyflakes a_python_file.py

which will print any errors found. Alternatively, you can run pyflakes directly:

$ python2 pyflakes/scripts/pyflakes.py a_python_file.py

Integration with Emacs or vim is also possible, and highly recommended.

Testing

TODO

Limitations

Pyflakes performs a purely syntactic analysis. For example, if you try to import from a non-existent file or access a non-existent object attribute, pyflakes will not produce an error.

Alternatives

pylint tries to solve a similar problem, but performs a dynamic analysis

Something went wrong with that request. Please try again.