Add flake8 (2.0)
authorGregory Szorc <gps@mozilla.com>
Mon, 22 Jul 2013 20:55:47 -0700
changeset 21 baf677f16f850924a9a3627e39d0bcde468faebe
parent 20 3f6f66219a7232c94d9dbc88e9570e19d59d0476
child 22 a72cc7e9d88127b9cf22a79695ac9701adf095d2
push id9
push usergszorc@mozilla.com
push dateTue, 23 Jul 2013 03:56:04 +0000
Add flake8 (2.0)
flake8/CHANGES.rst
flake8/CONTRIBUTORS.txt
flake8/LICENSE
flake8/MANIFEST.in
flake8/PKG-INFO
flake8/README.rst
flake8/flake8.egg-info/PKG-INFO
flake8/flake8.egg-info/SOURCES.txt
flake8/flake8.egg-info/dependency_links.txt
flake8/flake8.egg-info/entry_points.txt
flake8/flake8.egg-info/requires.txt
flake8/flake8.egg-info/top_level.txt
flake8/flake8/__init__.py
flake8/flake8/_pyflakes.py
flake8/flake8/engine.py
flake8/flake8/hooks.py
flake8/flake8/main.py
flake8/flake8/run.py
flake8/flake8/tests/__init__.py
flake8/flake8/tests/test_flakes.py
flake8/flake8/util.py
flake8/scripts/flake8.cmd
flake8/setup.cfg
flake8/setup.py
new file mode 100644
--- /dev/null
+++ b/flake8/CHANGES.rst
@@ -0,0 +1,141 @@
+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
new file mode 100644
--- /dev/null
+++ b/flake8/CONTRIBUTORS.txt
@@ -0,0 +1,21 @@
+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
new file mode 100644
--- /dev/null
+++ b/flake8/LICENSE
@@ -0,0 +1,21 @@
+== 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.
new file mode 100644
--- /dev/null
+++ b/flake8/MANIFEST.in
@@ -0,0 +1,4 @@
+include *.rst
+include CONTRIBUTORS.txt
+include LICENSE
+recursive-include scripts flake8.*
new file mode 100644
--- /dev/null
+++ b/flake8/PKG-INFO
@@ -0,0 +1,229 @@
+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
new file mode 100644
--- /dev/null
+++ b/flake8/README.rst
@@ -0,0 +1,68 @@
+======
+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/>`_
new file mode 100644
--- /dev/null
+++ b/flake8/flake8.egg-info/PKG-INFO
@@ -0,0 +1,229 @@
+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
new file mode 100644
--- /dev/null
+++ b/flake8/flake8.egg-info/SOURCES.txt
@@ -0,0 +1,22 @@
+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
new file mode 100644
--- /dev/null
+++ b/flake8/flake8.egg-info/dependency_links.txt
@@ -0,0 +1,1 @@
+
new file mode 100644
--- /dev/null
+++ b/flake8/flake8.egg-info/entry_points.txt
@@ -0,0 +1,9 @@
+[flake8.extension]
+F = flake8._pyflakes:FlakesChecker
+
+[console_scripts]
+flake8 = flake8.main:main
+
+[distutils.commands]
+flake8 = flake8.main:Flake8Command
+
new file mode 100644
--- /dev/null
+++ b/flake8/flake8.egg-info/requires.txt
@@ -0,0 +1,4 @@
+setuptools
+pyflakes >= 0.6.1
+pep8 >= 1.4.3
+mccabe >= 0.2
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/flake8/flake8.egg-info/top_level.txt
@@ -0,0 +1,1 @@
+flake8
new file mode 100644
--- /dev/null
+++ b/flake8/flake8/__init__.py
@@ -0,0 +1,2 @@
+
+__version__ = '2.0'
new file mode 100644
--- /dev/null
+++ b/flake8/flake8/_pyflakes.py
@@ -0,0 +1,47 @@
+# -*- 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',
+        'F841 UnusedVariable',
+    )])
+
+    for name, obj in vars(pyflakes.messages).items():
+        if name[0].isupper() and obj.message:
+            obj.flake8_msg = '%s %s' % (codes.get(name, 'F999'), obj.message)
+patch_pyflakes()
+
+
+class FlakesChecker(pyflakes.checker.Checker):
+    """Subclass the Pyflakes checker to conform with the flake8 API."""
+    name = 'pyflakes'
+    version = pyflakes.__version__
+
+    @classmethod
+    def add_options(cls, parser):
+        parser.add_option('--builtins',
+                          help="define more built-ins, comma separated")
+        parser.config_options.append('builtins')
+
+    @classmethod
+    def parse_options(cls, options):
+        if options.builtins:
+            cls.builtIns = cls.builtIns.union(options.builtins.split(','))
+
+    def run(self):
+        for m in self.messages:
+            yield m.lineno, 0, (m.flake8_msg % m.message_args), m.__class__
new file mode 100644
--- /dev/null
+++ b/flake8/flake8/engine.py
@@ -0,0 +1,80 @@
+# -*- coding: utf-8 -*-
+import re
+
+import pep8
+
+from flake8 import __version__
+from flake8.util import OrderedSet
+
+_flake8_noqa = re.compile(r'flake8[:=]\s*noqa', re.I).search
+
+
+def _register_extensions():
+    """Register all the extensions."""
+    extensions = OrderedSet()
+    extensions.add(('pep8', pep8.__version__))
+    parser_hooks = []
+    options_hooks = []
+    try:
+        from pkg_resources import iter_entry_points
+    except ImportError:
+        pass
+    else:
+        for entry in iter_entry_points('flake8.extension'):
+            checker = entry.load()
+            pep8.register_check(checker, codes=[entry.name])
+            extensions.add((checker.name, checker.version))
+            if hasattr(checker, 'add_options'):
+                parser_hooks.append(checker.add_options)
+            if hasattr(checker, 'parse_options'):
+                options_hooks.append(checker.parse_options)
+    return extensions, parser_hooks, options_hooks
+
+
+def get_parser():
+    """This returns an instance of optparse.OptionParser with all the
+    extensions registered and options set. This wraps ``pep8.get_parser``.
+    """
+    (extensions, parser_hooks, options_hooks) = _register_extensions()
+    details = ', '.join(['%s: %s' % ext for ext in extensions])
+    parser = pep8.get_parser('flake8', '%s (%s)' % (__version__, details))
+    for opt in ('--repeat', '--testsuite', '--doctest'):
+        try:
+            parser.remove_option(opt)
+        except ValueError:
+            pass
+    parser.add_option('--exit-zero', action='store_true',
+                      help="exit with code 0 even if there are errors")
+    for parser_hook in parser_hooks:
+        parser_hook(parser)
+    parser.add_option('--install-hook', default=False, action='store_true',
+                      help='Install the appropriate hook for this '
+                      'repository.', dest='install_hook')
+    return parser, options_hooks
+
+
+class StyleGuide(pep8.StyleGuide):
+    # Backward compatibility pep8 <= 1.4.2
+    checker_class = pep8.Checker
+
+    def input_file(self, filename, lines=None, expected=None, line_offset=0):
+        """Run all checks on a Python source file."""
+        if self.options.verbose:
+            print('checking %s' % filename)
+        fchecker = self.checker_class(
+            filename, lines=lines, options=self.options)
+        # Any "# flake8: noqa" line?
+        if any(_flake8_noqa(line) for line in fchecker.lines):
+            return 0
+        return fchecker.check_all(expected=expected, line_offset=line_offset)
+
+
+def get_style_guide(**kwargs):
+    """Parse the options and configure the checker. This returns a sub-class 
+    of ``pep8.StyleGuide``."""
+    kwargs['parser'], options_hooks = get_parser()
+    styleguide = StyleGuide(**kwargs)
+    options = styleguide.options
+    for options_hook in options_hooks:
+        options_hook(options)
+    return styleguide
new file mode 100644
--- /dev/null
+++ b/flake8/flake8/hooks.py
@@ -0,0 +1,156 @@
+# -*- coding: utf-8 -*-
+from __future__ import with_statement
+import os
+import sys
+from subprocess import Popen, PIPE
+try:
+    from configparser import ConfigParser
+except ImportError:   # Python 2
+    from ConfigParser import ConfigParser
+
+from flake8.engine import get_parser, get_style_guide
+from flake8.main import DEFAULT_CONFIG
+
+
+def git_hook(complexity=-1, strict=False, ignore=None, lazy=False):
+    """This is the function used by the git hook.
+    
+    :param int complexity: (optional), any value > 0 enables complexity
+        checking with mccabe
+    :param bool strict: (optional), if True, this returns the total number of
+        errors which will cause the hook to fail
+    :param str ignore: (optional), a comma-separated list of errors and
+        warnings to ignore
+    :param bool lazy: (optional), allows for the instances where you don't add
+        the files to the index before running a commit, e.g., git commit -a
+    :returns: total number of errors if strict is True, otherwise 0
+    """
+    gitcmd = "git diff-index --cached --name-only HEAD"
+    if lazy:
+        gitcmd = gitcmd.replace('--cached ', '')
+
+    _, files_modified, _ = run(gitcmd)
+
+    flake8_style = get_style_guide(
+        config_file=DEFAULT_CONFIG, ignore=ignore, max_complexity=complexity)
+    report = flake8_style.check_files(files_modified)
+
+    if strict:
+        return report.total_errors
+
+    return 0
+
+
+def hg_hook(ui, repo, **kwargs):
+    """This is the function executed directly by Mercurial as part of the
+    hook. This is never called directly by the user, so the parameters are
+    undocumented. If you would like to learn more about them, please feel free
+    to read the official Mercurial documentation.
+    """
+    complexity = ui.config('flake8', 'complexity', default=-1)
+    strict = ui.configbool('flake8', 'strict', default=True)
+    config = ui.config('flake8', 'config', default=True)
+    if config is True:
+        config = DEFAULT_CONFIG
+
+    paths = _get_files(repo, **kwargs)
+
+    flake8_style = get_style_guide(
+        config_file=config, max_complexity=complexity)
+    report = flake8_style.check_files(paths)
+
+    if strict:
+        return report.total_errors
+
+    return 0
+
+
+def run(command):
+    p = Popen(command.split(), stdout=PIPE, stderr=PIPE)
+    (stdout, stderr) = p.communicate()
+    return (p.returncode, [line.strip() for line in stdout.splitlines()],
+            [line.strip() for line in stderr.splitlines()])
+
+
+def _get_files(repo, **kwargs):
+    seen = set()
+    for rev in range(repo[kwargs['node']], len(repo)):
+        for file_ in repo[rev].files():
+            file_ = os.path.join(repo.root, file_)
+            if file_ in seen or not os.path.exists(file_):
+                continue
+            seen.add(file_)
+            if file_.endswith('.py'):
+                yield file_
+
+
+def find_vcs():
+    if os.path.isdir('.git'):
+        if not os.path.isdir('.git/hooks'):
+            os.mkdir('.git/hooks')
+        return '.git/hooks/pre-commit'
+    elif os.path.isdir('.hg'):
+        return '.hg/hgrc'
+    return ''
+
+
+git_hook_file = """#!/usr/bin/env python
+import sys
+import os
+from flake8.hooks import git_hook
+
+COMPLEXITY = os.getenv('FLAKE8_COMPLEXITY', 10)
+STRICT = os.getenv('FLAKE8_STRICT', False)
+
+
+if __name__ == '__main__':
+    sys.exit(git_hook(complexity=COMPLEXITY, strict=STRICT))
+"""
+
+
+def _install_hg_hook(path):
+    c = ConfigParser()
+    c.readfp(open(path, 'r'))
+    if not c.has_section('hooks'):
+        c.add_section('hooks')
+
+    if not c.has_option('hooks', 'commit'):
+        c.set('hooks', 'commit', 'python:flake8.hooks.hg_hook')
+
+    if not c.has_option('hooks', 'qrefresh'):
+        c.set('hooks', 'qrefresh', 'python:flake8.hooks.hg_hook')
+
+    if not c.has_section('flake8'):
+        c.add_section('flake8')
+
+    if not c.has_option('flake8', 'complexity'):
+        c.set('flake8', 'complexity', str(os.getenv('FLAKE8_COMPLEXITY', 10)))
+
+    if not c.has_option('flake8', 'strict'):
+        c.set('flake8', 'strict', os.getenv('FLAKE8_STRICT', False))
+
+    c.write(open(path, 'w+'))
+
+
+def install_hook():
+    vcs = find_vcs()
+
+    if not vcs:
+        p = get_parser()
+        sys.stderr.write('Error: could not find either a git or mercurial '
+                         'directory. Please re-run this in a proper '
+                         'repository.')
+        p.print_help()
+        sys.exit(1)
+
+    status = 0
+    if 'git' in vcs:
+        with open(vcs, 'w+') as fd:
+            fd.write(git_hook_file)
+        os.chmod(vcs, 744)
+    elif 'hg' in vcs:
+        _install_hg_hook(vcs)
+    else:
+        status = 1
+
+    sys.exit(status)
new file mode 100644
--- /dev/null
+++ b/flake8/flake8/main.py
@@ -0,0 +1,96 @@
+# -*- coding: utf-8 -*-
+import os
+import sys
+
+import setuptools
+
+from flake8.engine import get_style_guide
+
+if sys.platform.startswith('win'):
+    DEFAULT_CONFIG = os.path.expanduser(r'~\.flake8')
+else:
+    DEFAULT_CONFIG = os.path.join(
+        os.getenv('XDG_CONFIG_HOME') or os.path.expanduser('~/.config'),
+        'flake8'
+    )
+
+
+def main():
+    """Parse options and run checks on Python source."""
+    # Prepare
+    flake8_style = get_style_guide(parse_argv=True, config_file=DEFAULT_CONFIG)
+    options = flake8_style.options
+
+    if options.install_hook:
+        from flake8.hooks import install_hook
+        install_hook()
+
+    # Run the checkers
+    report = flake8_style.check_files()
+
+    # Print the final report
+    options = flake8_style.options
+    if options.statistics:
+        report.print_statistics()
+    if options.benchmark:
+        report.print_benchmark()
+    if report.total_errors:
+        if options.count:
+            sys.stderr.write(str(report.total_errors) + '\n')
+        if not options.exit_zero:
+            raise SystemExit(1)
+
+
+def check_file(path, ignore=(), complexity=-1):
+    """Checks a file using pep8 and pyflakes by default and mccabe 
+    optionally.
+
+    :param str path: path to the file to be checked
+    :param tuple ignore: (optional), error and warning codes to be ignored
+    :param int complexity: (optional), enables the mccabe check for values > 0
+    """
+    flake8_style = get_style_guide(
+        config_file=DEFAULT_CONFIG, ignore=ignore, max_complexity=complexity)
+    return flake8_style.input_file(path)
+
+
+def check_code(code, ignore=(), complexity=-1):
+    """Checks code using pep8 and pyflakes by default and mccabe optionally.
+
+    :param str code: code to be checked
+    :param tuple ignore: (optional), error and warning codes to be ignored
+    :param int complexity: (optional), enables the mccabe check for values > 0
+    """
+    flake8_style = get_style_guide(
+        config_file=DEFAULT_CONFIG, ignore=ignore, max_complexity=complexity)
+    return flake8_style.input_file('-', lines=code.splitlines())
+
+
+class Flake8Command(setuptools.Command):
+    """The :class:`Flake8Command` class is used by setuptools to perform
+    checks on registered modules.
+    """
+
+    description = "Run flake8 on modules registered in setuptools"
+    user_options = []
+
+    def initialize_options(self):
+        pass
+
+    def finalize_options(self):
+        pass
+
+    def distribution_files(self):
+        if self.distribution.packages:
+            for package in self.distribution.packages:
+                yield package.replace(".", os.path.sep)
+
+        if self.distribution.py_modules:
+            for filename in self.distribution.py_modules:
+                yield "%s.py" % filename
+
+    def run(self):
+        flake8_style = get_style_guide(config_file=DEFAULT_CONFIG)
+        paths = self.distribution_files()
+        report = flake8_style.check_files(paths)
+        raise SystemExit(report.total_errors > 0)
new file mode 100644
--- /dev/null
+++ b/flake8/flake8/run.py
@@ -0,0 +1,11 @@
+
+"""
+Implementation of the command-line I{flake8} tool.
+"""
+from flake8.hooks import git_hook, hg_hook                      # noqa
+from flake8.main import check_code, check_file, Flake8Command   # noqa
+from flake8.main import main
+
+
+if __name__ == '__main__':
+    main()
new file mode 100644
--- /dev/null
+++ b/flake8/flake8/tests/__init__.py
@@ -0,0 +1,1 @@
+#
new file mode 100644
--- /dev/null
+++ b/flake8/flake8/tests/test_flakes.py
@@ -0,0 +1,94 @@
+# -*- coding: utf-8 -*-
+import sys
+
+from unittest import TestCase
+from pyflakes.api import check
+
+
+class FlakesTestReporter(object):
+    def __init__(self):
+        self.messages = []
+        self.flakes = self.messages.append
+
+    def unexpectedError(self, filename, msg):
+        self.flakes('[unexpectedError] %s: %s' % (filename, msg))
+
+    def syntaxError(self, filename, msg, lineno, offset, text):
+        self.flakes('[syntaxError] %s:%d: %s' % (filename, lineno, msg))
+
+
+code0 = """
+try:
+    pass
+except ValueError, err:
+    print(err)
+"""
+
+code1 = """
+try:
+    pass
+except ValueError as err:
+    print(err)
+"""
+
+code2 = """
+try:
+    pass
+except ValueError:
+    print("err")
+
+try:
+    pass
+except ValueError:
+    print("err")
+"""
+
+code3 = """
+try:
+    pass
+except (ImportError, ValueError):
+    print("err")
+"""
+
+code_from_import_exception = """
+from foo import SomeException
+try:
+    pass
+except SomeException:
+    print("err")
+"""
+
+code_import_exception = """
+import foo.SomeException
+try:
+    pass
+except foo.SomeException:
+    print("err")
+"""
+
+
+class TestFlake(TestCase):
+
+    def test_exception(self):
+        codes = [code1, code2, code3]
+        if sys.version_info < (2, 6):
+            codes[0] = code0
+        elif sys.version_info < (3,):
+            codes.insert(0, code0)
+        for code in codes:
+            reporter = FlakesTestReporter()
+            warnings = check(code, '(stdin)', reporter)
+            self.assertFalse(reporter.messages)
+            self.assertEqual(warnings, 0)
+
+    def test_from_import_exception_in_scope(self):
+        reporter = FlakesTestReporter()
+        warnings = check(code_from_import_exception, '(stdin)', reporter)
+        self.assertFalse(reporter.messages)
+        self.assertEqual(warnings, 0)
+
+    def test_import_exception_in_scope(self):
+        reporter = FlakesTestReporter()
+        warnings = check(code_import_exception, '(stdin)', reporter)
+        self.assertFalse(reporter.messages)
+        self.assertEqual(warnings, 0)
new file mode 100644
--- /dev/null
+++ b/flake8/flake8/util.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+
+try:
+    import ast
+    iter_child_nodes = ast.iter_child_nodes
+except ImportError:   # Python 2.5
+    import _ast as ast
+
+    if 'decorator_list' not in ast.ClassDef._fields:
+        # Patch the missing attribute 'decorator_list'
+        ast.ClassDef.decorator_list = ()
+        ast.FunctionDef.decorator_list = property(lambda s: s.decorators)
+
+    def iter_child_nodes(node):
+        """
+        Yield all direct child nodes of *node*, that is, all fields that
+        are nodes and all items of fields that are lists of nodes.
+        """
+        if not node._fields:
+            return
+        for name in node._fields:
+            field = getattr(node, name, None)
+            if isinstance(field, ast.AST):
+                yield field
+            elif isinstance(field, list):
+                for item in field:
+                    if isinstance(item, ast.AST):
+                        yield item
+
+
+class OrderedSet(list):
+    """List without duplicates."""
+    __slots__ = ()
+
+    def add(self, value):
+        if value not in self:
+            self.append(value)
new file mode 100644
--- /dev/null
+++ b/flake8/scripts/flake8.cmd
@@ -0,0 +1,6 @@
+@setlocal enableextensions & python -x %~f0 %* & goto :EOF
+# -*- mode: python -*-
+from flake8.run import main
+
+if __name__ == '__main__':
+    main()
new file mode 100644
--- /dev/null
+++ b/flake8/setup.cfg
@@ -0,0 +1,5 @@
+[egg_info]
+tag_build = 
+tag_date = 0
+tag_svn_revision = 0
+
new file mode 100644
--- /dev/null
+++ b/flake8/setup.py
@@ -0,0 +1,58 @@
+# -*- coding: utf-8 -*-
+from __future__ import with_statement
+from setuptools import setup
+
+
+def get_version(fname='flake8/__init__.py'):
+    with open(fname) as f:
+        for line in f:
+            if line.startswith('__version__'):
+                return eval(line.split('=')[-1])
+
+
+def get_long_description():
+    descr = []
+    for fname in ('README.rst', 'CHANGES.rst'):
+        with open(fname) as f:
+            descr.append(f.read())
+    return '\n\n'.join(descr)
+
+
+setup(
+    name="flake8",
+    license="MIT",
+    version=get_version(),
+    description="the modular source code checker: pep8, pyflakes and co",
+    long_description=get_long_description(),
+    author="Tarek Ziade",
+    author_email="tarek@ziade.org",
+    maintainer="Ian Cordasco",
+    maintainer_email="graffatcolmingov@gmail.com",
+    url="http://bitbucket.org/tarek/flake8",
+    packages=["flake8", "flake8.tests"],
+    install_requires=[
+        "setuptools",
+        "pyflakes >= 0.6.1",
+        "pep8 >= 1.4.3",
+        "mccabe >= 0.2",
+    ],
+    entry_points={
+        'distutils.commands': ['flake8 = flake8.main:Flake8Command'],
+        'console_scripts': ['flake8 = flake8.main:main'],
+        'flake8.extension': [
+            'F = flake8._pyflakes:FlakesChecker',
+        ],
+    },
+    classifiers=[
+        "Environment :: Console",
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: MIT License",
+        "Programming Language :: Python",
+        "Programming Language :: Python :: 2",
+        "Programming Language :: Python :: 3",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+        "Topic :: Software Development :: Quality Assurance",
+    ],
+    tests_require=['nose'],
+    test_suite='nose.collector',
+)