Commit 3fef12d2 authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 2.0

parents
CHANGES
=======
2.0.0 - 2013-02-xx
------------------
- Pyflakes errors are prefixed by an ``F`` instead of an ``E``
- McCabe complexity warnings are prefixed by a ``C`` instead of a ``W``
- Flake8 supports extensions through entry points
- Due to the above support, we **require** setuptools
- We publish the `documentation <https://flake8.readthedocs.org/>`_
- Fixes #13: pep8, pyflakes and mccabe become external dependencies
- Split run.py into main.py, engine.py and hooks.py for better logic
- Expose our parser for our users
- New feature: Install git and hg hooks automagically
- By relying on pyflakes (0.6.1), we also fixed #45 and #35
1.7.0 - 2012-12-21
------------------
- Fixes part of #35: Exception for no WITHITEM being an attribute of Checker
for Python 3.3
- Support stdin
- Incorporate @phd's builtins pull request
- Fix the git hook
- Update pep8.py to the latest version
1.6.2 - 2012-11-25
------------------
- fixed the NameError: global name 'message' is not defined (#46)
1.6.1 - 2012-11-24
------------------
- fixed the mercurial hook, a change from a previous patch was not properly
applied
- fixed an assumption about warnings/error messages that caused an exception
to be thrown when McCabe is used
1.6 - 2012-11-16
----------------
- changed the signatures of the ``check_file`` function in flake8/run.py,
``skip_warning`` in flake8/util.py and the ``check``, ``checkPath``
functions in flake8/pyflakes.py.
- fix ``--exclude`` and ``--ignore`` command flags (#14, #19)
- fix the git hook that wasn't catching files not already added to the index
(#29)
- pre-emptively includes the addition to pep8 to ignore certain lines.
Add ``# nopep8`` to the end of a line to ignore it. (#37)
- ``check_file`` can now be used without any special prior setup (#21)
- unpacking exceptions will no longer cause an exception (#20)
- fixed crash on non-existent file (#38)
1.5 - 2012-10-13
----------------
- fixed the stdin
- make sure mccabe catches the syntax errors as warnings
- pep8 upgrade
- added max_line_length default value
- added Flake8Command and entry points is setuptools is around
- using the setuptools console wrapper when available
1.4 - 2012-07-12
----------------
- git_hook: Only check staged changes for compliance
- use pep8 1.2
1.3.1 - 2012-05-19
------------------
- fixed support for Python 2.5
1.3 - 2012-03-12
----------------
- fixed false W402 warning on exception blocks.
1.2 - 2012-02-12
----------------
- added a git hook
- now Python 3 compatible
- mccabe and pyflakes have warning codes like pep8 now
1.1 - 2012-02-14
----------------
- fixed the value returned by --version
- allow the flake8: header to be more generic
- fixed the "hg hook raises 'physical lines'" bug
- allow three argument form of raise
- now uses setuptools if available, for 'develop' command
1.0 - 2011-11-29
----------------
- Deactivates by default the complexity checker
- Introduces the complexity option in the HG hook and the command line.
0.9 - 2011-11-09
----------------
- update pep8 version to 0.6.1
- mccabe check: gracefully handle compile failure
0.8 - 2011-02-27
----------------
- fixed hg hook
- discard unexisting files on hook check
0.7 - 2010-02-18
----------------
- Fix pep8 initialization when run through Hg
- Make pep8 short options work when run through the command line
- Skip duplicates when controlling files via Hg
0.6 - 2010-02-15
----------------
- Fix the McCabe metric on some loops
Project created by Tarek Ziadé.
Contributors (by order of appearance) :
- Tamás Gulácsi
- Nicolas Dumazet
- Stefan Scherfke
- Chris Adams
- Ben Bass
- Ask Solem
- Steven Kryskalla
- Gustavo Picon
- Jannis Leidel
- Miki Tebeka
- David Cramer
- Peter Teichman
- Ian Cordasco
- Oleg Broytman
- Marc Labbé
- Bruno Miguel Custódio
- Florent Xicluna
== Flake8 License (MIT) ==
Copyright (C) 2011 Tarek Ziade <tarek@ziade.org>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
include *.rst
include CONTRIBUTORS.txt
include LICENSE
recursive-include scripts flake8.*
Metadata-Version: 1.0
Name: flake8
Version: 2.0
Summary: the modular source code checker: pep8, pyflakes and co
Home-page: http://bitbucket.org/tarek/flake8
Author: Ian Cordasco
Author-email: graffatcolmingov@gmail.com
License: MIT
Description: ======
Flake8
======
Flake8 is a wrapper around these tools:
- PyFlakes
- pep8
- Ned Batchelder's McCabe script
Flake8 runs all the tools by launching the single ``flake8`` script.
It displays the warnings in a per-file, merged output.
It also adds a few features:
- files that contain this line are skipped::
# flake8: noqa
- lines that contain a ``# noqa`` comment at the end will not issue warnings.
- a Git and a Mercurial hook.
- a McCabe complexity checker.
- extendable through ``flake8.extension`` entry points.
QuickStart
==========
::
pip install flake8
To run flake8 just invoke it against any directory or Python module::
$ flake8 coolproject
coolproject/mod.py:97:1: F401 'shutil' imported but unused
coolproject/mod.py:625:17: E225 missing whitespace around operato
coolproject/mod.py:729:1: F811 redefinition of function 'readlines' from line 723
coolproject/mod.py:1028:1: F841 local variable 'errors' is assigned to but never used
The outputs of PyFlakes *and* pep8 (and the optional plugins) are merged
and returned.
flake8 offers an extra option: --max-complexity, which will emit a warning if
the McCabe complexity of a function is higher than the value. By default it's
deactivated::
$ flake8 --max-complexity 12 coolproject
coolproject/mod.py:97:1: F401 'shutil' imported but unused
coolproject/mod.py:625:17: E225 missing whitespace around operator
coolproject/mod.py:729:1: F811 redefinition of unused 'readlines' from line 723
coolproject/mod.py:939:1: C901 'Checker.check_all' is too complex (12)
coolproject/mod.py:1028:1: F841 local variable 'errors' is assigned to but never used
coolproject/mod.py:1204:1: C901 'selftest' is too complex (14)
This feature is quite useful to detect over-complex code. According to McCabe,
anything that goes beyond 10 is too complex.
See https://en.wikipedia.org/wiki/Cyclomatic_complexity.
.. _links:
Links
=====
* `flake8 documentation <http://flake8.readthedocs.org/en/latest/>`_
* `pep8 documentation <http://pep8.readthedocs.org/en/latest/>`_
CHANGES
=======
2.0.0 - 2013-02-xx
------------------
- Pyflakes errors are prefixed by an ``F`` instead of an ``E``
- McCabe complexity warnings are prefixed by a ``C`` instead of a ``W``
- Flake8 supports extensions through entry points
- Due to the above support, we **require** setuptools
- We publish the `documentation <https://flake8.readthedocs.org/>`_
- Fixes #13: pep8, pyflakes and mccabe become external dependencies
- Split run.py into main.py, engine.py and hooks.py for better logic
- Expose our parser for our users
- New feature: Install git and hg hooks automagically
- By relying on pyflakes (0.6.1), we also fixed #45 and #35
1.7.0 - 2012-12-21
------------------
- Fixes part of #35: Exception for no WITHITEM being an attribute of Checker
for Python 3.3
- Support stdin
- Incorporate @phd's builtins pull request
- Fix the git hook
- Update pep8.py to the latest version
1.6.2 - 2012-11-25
------------------
- fixed the NameError: global name 'message' is not defined (#46)
1.6.1 - 2012-11-24
------------------
- fixed the mercurial hook, a change from a previous patch was not properly
applied
- fixed an assumption about warnings/error messages that caused an exception
to be thrown when McCabe is used
1.6 - 2012-11-16
----------------
- changed the signatures of the ``check_file`` function in flake8/run.py,
``skip_warning`` in flake8/util.py and the ``check``, ``checkPath``
functions in flake8/pyflakes.py.
- fix ``--exclude`` and ``--ignore`` command flags (#14, #19)
- fix the git hook that wasn't catching files not already added to the index
(#29)
- pre-emptively includes the addition to pep8 to ignore certain lines.
Add ``# nopep8`` to the end of a line to ignore it. (#37)
- ``check_file`` can now be used without any special prior setup (#21)
- unpacking exceptions will no longer cause an exception (#20)
- fixed crash on non-existent file (#38)
1.5 - 2012-10-13
----------------
- fixed the stdin
- make sure mccabe catches the syntax errors as warnings
- pep8 upgrade
- added max_line_length default value
- added Flake8Command and entry points is setuptools is around
- using the setuptools console wrapper when available
1.4 - 2012-07-12
----------------
- git_hook: Only check staged changes for compliance
- use pep8 1.2
1.3.1 - 2012-05-19
------------------
- fixed support for Python 2.5
1.3 - 2012-03-12
----------------
- fixed false W402 warning on exception blocks.
1.2 - 2012-02-12
----------------
- added a git hook
- now Python 3 compatible
- mccabe and pyflakes have warning codes like pep8 now
1.1 - 2012-02-14
----------------
- fixed the value returned by --version
- allow the flake8: header to be more generic
- fixed the "hg hook raises 'physical lines'" bug
- allow three argument form of raise
- now uses setuptools if available, for 'develop' command
1.0 - 2011-11-29
----------------
- Deactivates by default the complexity checker
- Introduces the complexity option in the HG hook and the command line.
0.9 - 2011-11-09
----------------
- update pep8 version to 0.6.1
- mccabe check: gracefully handle compile failure
0.8 - 2011-02-27
----------------
- fixed hg hook
- discard unexisting files on hook check
0.7 - 2010-02-18
----------------
- Fix pep8 initialization when run through Hg
- Make pep8 short options work when run through the command line
- Skip duplicates when controlling files via Hg
0.6 - 2010-02-15
----------------
- Fix the McCabe metric on some loops
Platform: UNKNOWN
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
======
Flake8
======
Flake8 is a wrapper around these tools:
- PyFlakes
- pep8
- Ned Batchelder's McCabe script
Flake8 runs all the tools by launching the single ``flake8`` script.
It displays the warnings in a per-file, merged output.
It also adds a few features:
- files that contain this line are skipped::
# flake8: noqa
- lines that contain a ``# noqa`` comment at the end will not issue warnings.
- a Git and a Mercurial hook.
- a McCabe complexity checker.
- extendable through ``flake8.extension`` entry points.
QuickStart
==========
::
pip install flake8
To run flake8 just invoke it against any directory or Python module::
$ flake8 coolproject
coolproject/mod.py:97:1: F401 'shutil' imported but unused
coolproject/mod.py:625:17: E225 missing whitespace around operato
coolproject/mod.py:729:1: F811 redefinition of function 'readlines' from line 723
coolproject/mod.py:1028:1: F841 local variable 'errors' is assigned to but never used
The outputs of PyFlakes *and* pep8 (and the optional plugins) are merged
and returned.
flake8 offers an extra option: --max-complexity, which will emit a warning if
the McCabe complexity of a function is higher than the value. By default it's
deactivated::
$ flake8 --max-complexity 12 coolproject
coolproject/mod.py:97:1: F401 'shutil' imported but unused
coolproject/mod.py:625:17: E225 missing whitespace around operator
coolproject/mod.py:729:1: F811 redefinition of unused 'readlines' from line 723
coolproject/mod.py:939:1: C901 'Checker.check_all' is too complex (12)
coolproject/mod.py:1028:1: F841 local variable 'errors' is assigned to but never used
coolproject/mod.py:1204:1: C901 'selftest' is too complex (14)
This feature is quite useful to detect over-complex code. According to McCabe,
anything that goes beyond 10 is too complex.
See https://en.wikipedia.org/wiki/Cyclomatic_complexity.
.. _links:
Links
=====
* `flake8 documentation <http://flake8.readthedocs.org/en/latest/>`_
* `pep8 documentation <http://pep8.readthedocs.org/en/latest/>`_
Metadata-Version: 1.0
Name: flake8
Version: 2.0
Summary: the modular source code checker: pep8, pyflakes and co
Home-page: http://bitbucket.org/tarek/flake8
Author: Ian Cordasco
Author-email: graffatcolmingov@gmail.com
License: MIT
Description: ======
Flake8
======
Flake8 is a wrapper around these tools:
- PyFlakes
- pep8
- Ned Batchelder's McCabe script
Flake8 runs all the tools by launching the single ``flake8`` script.
It displays the warnings in a per-file, merged output.
It also adds a few features:
- files that contain this line are skipped::
# flake8: noqa
- lines that contain a ``# noqa`` comment at the end will not issue warnings.
- a Git and a Mercurial hook.
- a McCabe complexity checker.
- extendable through ``flake8.extension`` entry points.
QuickStart
==========
::
pip install flake8
To run flake8 just invoke it against any directory or Python module::
$ flake8 coolproject
coolproject/mod.py:97:1: F401 'shutil' imported but unused
coolproject/mod.py:625:17: E225 missing whitespace around operato
coolproject/mod.py:729:1: F811 redefinition of function 'readlines' from line 723
coolproject/mod.py:1028:1: F841 local variable 'errors' is assigned to but never used
The outputs of PyFlakes *and* pep8 (and the optional plugins) are merged
and returned.
flake8 offers an extra option: --max-complexity, which will emit a warning if
the McCabe complexity of a function is higher than the value. By default it's
deactivated::
$ flake8 --max-complexity 12 coolproject
coolproject/mod.py:97:1: F401 'shutil' imported but unused
coolproject/mod.py:625:17: E225 missing whitespace around operator
coolproject/mod.py:729:1: F811 redefinition of unused 'readlines' from line 723
coolproject/mod.py:939:1: C901 'Checker.check_all' is too complex (12)
coolproject/mod.py:1028:1: F841 local variable 'errors' is assigned to but never used
coolproject/mod.py:1204:1: C901 'selftest' is too complex (14)
This feature is quite useful to detect over-complex code. According to McCabe,
anything that goes beyond 10 is too complex.
See https://en.wikipedia.org/wiki/Cyclomatic_complexity.
.. _links:
Links
=====
* `flake8 documentation <http://flake8.readthedocs.org/en/latest/>`_
* `pep8 documentation <http://pep8.readthedocs.org/en/latest/>`_
CHANGES
=======
2.0.0 - 2013-02-xx
------------------
- Pyflakes errors are prefixed by an ``F`` instead of an ``E``
- McCabe complexity warnings are prefixed by a ``C`` instead of a ``W``
- Flake8 supports extensions through entry points
- Due to the above support, we **require** setuptools
- We publish the `documentation <https://flake8.readthedocs.org/>`_
- Fixes #13: pep8, pyflakes and mccabe become external dependencies
- Split run.py into main.py, engine.py and hooks.py for better logic
- Expose our parser for our users
- New feature: Install git and hg hooks automagically
- By relying on pyflakes (0.6.1), we also fixed #45 and #35
1.7.0 - 2012-12-21
------------------
- Fixes part of #35: Exception for no WITHITEM being an attribute of Checker
for Python 3.3
- Support stdin
- Incorporate @phd's builtins pull request
- Fix the git hook
- Update pep8.py to the latest version
1.6.2 - 2012-11-25
------------------
- fixed the NameError: global name 'message' is not defined (#46)
1.6.1 - 2012-11-24
------------------
- fixed the mercurial hook, a change from a previous patch was not properly
applied
- fixed an assumption about warnings/error messages that caused an exception
to be thrown when McCabe is used
1.6 - 2012-11-16
----------------
- changed the signatures of the ``check_file`` function in flake8/run.py,
``skip_warning`` in flake8/util.py and the ``check``, ``checkPath``
functions in flake8/pyflakes.py.
- fix ``--exclude`` and ``--ignore`` command flags (#14, #19)
- fix the git hook that wasn't catching files not already added to the index
(#29)
- pre-emptively includes the addition to pep8 to ignore certain lines.
Add ``# nopep8`` to the end of a line to ignore it. (#37)
- ``check_file`` can now be used without any special prior setup (#21)
- unpacking exceptions will no longer cause an exception (#20)
- fixed crash on non-existent file (#38)
1.5 - 2012-10-13
----------------
- fixed the stdin
- make sure mccabe catches the syntax errors as warnings
- pep8 upgrade
- added max_line_length default value
- added Flake8Command and entry points is setuptools is around
- using the setuptools console wrapper when available
1.4 - 2012-07-12
----------------
- git_hook: Only check staged changes for compliance
- use pep8 1.2
1.3.1 - 2012-05-19
------------------
- fixed support for Python 2.5
1.3 - 2012-03-12
----------------
- fixed false W402 warning on exception blocks.
1.2 - 2012-02-12
----------------
- added a git hook
- now Python 3 compatible
- mccabe and pyflakes have warning codes like pep8 now
1.1 - 2012-02-14
----------------
- fixed the value returned by --version
- allow the flake8: header to be more generic
- fixed the "hg hook raises 'physical lines'" bug
- allow three argument form of raise
- now uses setuptools if available, for 'develop' command
1.0 - 2011-11-29
----------------
- Deactivates by default the complexity checker
- Introduces the complexity option in the HG hook and the command line.
0.9 - 2011-11-09
----------------
- update pep8 version to 0.6.1
- mccabe check: gracefully handle compile failure
0.8 - 2011-02-27
----------------
- fixed hg hook
- discard unexisting files on hook check
0.7 - 2010-02-18
----------------
- Fix pep8 initialization when run through Hg
- Make pep8 short options work when run through the command line
- Skip duplicates when controlling files via Hg
0.6 - 2010-02-15
----------------
- Fix the McCabe metric on some loops
Platform: UNKNOWN
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
CHANGES.rst
CONTRIBUTORS.txt
LICENSE
MANIFEST.in
README.rst
setup.py
flake8/__init__.py
flake8/_pyflakes.py
flake8/engine.py
flake8/hooks.py
flake8/main.py
flake8/run.py
flake8/util.py
flake8.egg-info/PKG-INFO
flake8.egg-info/SOURCES.txt
flake8.egg-info/dependency_links.txt
flake8.egg-info/entry_points.txt
flake8.egg-info/requires.txt
flake8.egg-info/top_level.txt
flake8/tests/__init__.py
flake8/tests/test_flakes.py
scripts/flake8.cmd
\ No newline at end of file
[flake8.extension]
F = flake8._pyflakes:FlakesChecker
[console_scripts]
flake8 = flake8.main:main
[distutils.commands]
flake8 = flake8.main:Flake8Command
setuptools
pyflakes >= 0.6.1
pep8 >= 1.4.3
mccabe >= 0.2
\ No newline at end of file
__version__ = '2.0'
# -*- coding: utf-8 -*-
import pyflakes
import pyflakes.checker
def patch_pyflakes():
"""Add error codes to Pyflakes messages."""
codes = dict([line.split()[::-1] for line in (
'F401 UnusedImport',
'F402 ImportShadowedByLoopVar',
'F403 ImportStarUsed',
'F404 LateFutureImport',
'F810 Redefined', # XXX Obsolete?
'F811 RedefinedWhileUnused',
'F812 RedefinedInListComp',
'F821 UndefinedName',
'F822 UndefinedExport',
'F823 UndefinedLocal',
'F831 DuplicateArgument',
'F8