From 527af5c214ef0eccfde3dd58d7ea15e09c483bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 3 Jun 2018 22:18:48 +0200 Subject: [PATCH] Update to pyflakes 2.0.0 - Add new pyflakes codes - Bump the required versions - Fixes https://gitlab.com/pycqa/flake8/issues/422 --- docs/source/user/error-codes.rst | 6 ++++++ setup.cfg | 2 +- setup.py | 2 +- src/flake8/plugins/pyflakes.py | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) Index: flake8-3.5.0/docs/source/user/error-codes.rst =================================================================== --- flake8-3.5.0.orig/docs/source/user/error-codes.rst +++ flake8-3.5.0/docs/source/user/error-codes.rst @@ -54,6 +54,9 @@ generates its own :term:`error code`\ s +------+---------------------------------------------------------------------+ | F707 | an ``except:`` block as not the last exception handler | +------+---------------------------------------------------------------------+ +| F721 | doctest syntax error | +| F722 | syntax error in forward type annotation | ++------+---------------------------------------------------------------------+ +------+---------------------------------------------------------------------+ | F811 | redefinition of unused ``name`` from line ``N`` | +------+---------------------------------------------------------------------+ @@ -69,6 +72,9 @@ generates its own :term:`error code`\ s +------+---------------------------------------------------------------------+ | F841 | local variable ``name`` is assigned to but never used | +------+---------------------------------------------------------------------+ ++------+---------------------------------------------------------------------+ +| F901 | ``raise NotImplemented`` should be ``raise NotImplementedError`` | ++------+---------------------------------------------------------------------+ Note that some of these entries behave differently on Python 2 and Python 3, for example F812 is specific to Python 2 only. Index: flake8-3.5.0/setup.cfg =================================================================== --- flake8-3.5.0.orig/setup.cfg +++ flake8-3.5.0/setup.cfg @@ -8,7 +8,7 @@ universal = 1 requires-dist = enum34; python_version<"3.4" configparser; python_version<"3.2" - pyflakes >= 1.5.0, < 1.7.0 + pyflakes >= 2.0.0, < 2.1.0 pycodestyle >= 2.0.0, < 2.5.0 mccabe >= 0.6.0, < 0.7.0 Index: flake8-3.5.0/setup.py =================================================================== --- flake8-3.5.0.orig/setup.py +++ flake8-3.5.0/setup.py @@ -21,7 +21,7 @@ requires = [ # http://flake8.pycqa.org/en/latest/faq.html#why-does-flake8-use-ranges-for-its-dependencies # And in which releases we will update those ranges here: # http://flake8.pycqa.org/en/latest/internal/releases.html#releasing-flake8 - "pyflakes >= 1.5.0, < 1.7.0", + "pyflakes >= 2.0.0, < 2.1.0", "pycodestyle >= 2.0.0, < 2.5.0", "mccabe >= 0.6.0, < 0.7.0", "setuptools >= 30", Index: flake8-3.5.0/src/flake8/plugins/pyflakes.py =================================================================== --- flake8-3.5.0.orig/src/flake8/plugins/pyflakes.py +++ flake8-3.5.0/src/flake8/plugins/pyflakes.py @@ -38,6 +38,7 @@ FLAKE8_PYFLAKES_CODES = { 'ReturnOutsideFunction': 'F706', 'DefaultExceptNotLast': 'F707', 'DoctestSyntaxError': 'F721', + 'ForwardAnnotationSyntaxError': 'F722', 'RedefinedWhileUnused': 'F811', 'RedefinedInListComp': 'F812', 'UndefinedName': 'F821', @@ -45,6 +46,7 @@ FLAKE8_PYFLAKES_CODES = { 'UndefinedLocal': 'F823', 'DuplicateArgument': 'F831', 'UnusedVariable': 'F841', + 'RaiseNotImplemented': 'F901', }