flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code. https://flake8.pycqa.org
Find a file
2011-02-18 09:19:55 +01:00
bin code cleanup 2011-02-13 12:35:01 +01:00
flake8 merged 2011-02-18 09:07:23 +01:00
.hgignore code cleanup 2011-02-13 12:35:01 +01:00
.hgtags Added tag 0.6 for changeset a914ae72b4ea 2011-02-15 11:55:56 +01:00
CONTRIBUTORS.txt use mercurial's ui.configbool API to retrieve booleans 2011-02-18 12:20:34 +09:00
LICENSE initial commit 2010-08-12 14:40:53 +02:00
MANIFEST.in added a contributors file 2011-02-16 20:49:11 +01:00
README added a CHANGES section 2011-02-18 09:19:55 +01:00
setup.py bumped release 2011-02-18 09:16:39 +01:00

======
Flake8
======

Flake8 is a wrapper around these tools:

- PyFlakes
- pep8
- Ned's MacCabe script

Flake8 runs all tools by launching the single 'flake8' script, but ignores pep8 
and PyFlakes extended options and just uses defaults. It displays the warnings
in a per-file, merged output.

It also adds a few features:

- files that starts with this header are skipped::

    # flake8: noqa

- lines that contains a "# NOQA" comment at the end will not issue a warning
- a Mercurial hook
- more things to come..

Original projects:

- pep8: http://github.com/jcrocholl/pep8/
- PyFlakes: http://divmod.org/trac/wiki/DivmodPyflakes
- McCabe: http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html


Mercurial hook
==============

To use the Mercurial hook on any *commit* or *qrefresh*, change your .hg/rc file
like this::

    [hooks]
    commit = python:flake8.run.hg_hook
    qrefresh = python:flake8.run.hg_hook

    [flake8]
    strict = 0


If *strict* option is set to **1**, any warning will block the commit. When
*strict* is set to **0**, warnings are just displayed in the standard output.

CHANGES
=======

0.7 - 2010-02-18
----------------

- Fix pep8 intialization when run through Hg
- Make pep8 short options work when run throug the command line
- skip duplicates when controlling files via Hg


0.6 - 2010-02-15
----------------

- Fix the McCabe metric on some loops