Support pyflakes 2.2.x

This commit is contained in:
Anthony Sottile 2020-04-10 18:53:10 -07:00
parent 1be8707dc7
commit 76eeccad89
3 changed files with 51 additions and 2 deletions

View file

@ -29,6 +29,37 @@ generates its own :term:`error code`\ s for ``pyflakes``:
| F407 | an undefined ``__future__`` feature name was imported |
+------+---------------------------------------------------------------------+
+------+---------------------------------------------------------------------+
| F501 | invalid ``%`` format literal |
+------+---------------------------------------------------------------------+
| F502 | ``%`` format expected mapping but got sequence |
+------+---------------------------------------------------------------------+
| F503 | ``%`` format expected sequence but got mapping |
+------+---------------------------------------------------------------------+
| F504 | ``%`` format unused named arguments |
+------+---------------------------------------------------------------------+
| F505 | ``%`` format missing named arguments |
+------+---------------------------------------------------------------------+
| F506 | ``%`` format mixed positional and named arguments |
+------+---------------------------------------------------------------------+
| F507 | ``%`` format mismatch of placeholder and argument count |
+------+---------------------------------------------------------------------+
| F508 | ``%`` format with ``*`` specifier requires a sequence |
+------+---------------------------------------------------------------------+
| F509 | ``%`` format with unsupported format character |
+------+---------------------------------------------------------------------+
| F521 | ``.format(...)`` invalid format string |
+------+---------------------------------------------------------------------+
| F522 | ``.format(...)`` unused named arguments |
+------+---------------------------------------------------------------------+
| F523 | ``.format(...)`` unused positional arguments |
+------+---------------------------------------------------------------------+
| F524 | ``.format(...)`` missing argument |
+------+---------------------------------------------------------------------+
| F525 | ``.format(...)`` mixing automatic and manual numbering |
+------+---------------------------------------------------------------------+
| F541 | f-string without any placeholders |
+------+---------------------------------------------------------------------+
+------+---------------------------------------------------------------------+
| F601 | dictionary key ``name`` repeated with different values |
+------+---------------------------------------------------------------------+
| F602 | dictionary key variable ``name`` repeated with different values |
@ -37,12 +68,14 @@ generates its own :term:`error code`\ s for ``pyflakes``:
+------+---------------------------------------------------------------------+
| F622 | two or more starred expressions in an assignment ``(a, *b, *c = d)``|
+------+---------------------------------------------------------------------+
| F631 | assertion test is a tuple, which are always ``True`` |
| F631 | assertion test is a tuple, which is always ``True`` |
+------+---------------------------------------------------------------------+
| F632 | use ``==/!=`` to compare ``str``, ``bytes``, and ``int`` literals |
+------+---------------------------------------------------------------------+
| F633 | use of ``>>`` is invalid with ``print`` function |
+------+---------------------------------------------------------------------+
| F634 | if test is a tuple, which is always ``True`` |
+------+---------------------------------------------------------------------+
+------+---------------------------------------------------------------------+
| F701 | a ``break`` statement outside of a ``while`` or ``for`` loop |
+------+---------------------------------------------------------------------+

View file

@ -41,7 +41,7 @@ install_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 >= 2.1.0, < 2.2.0
pyflakes >= 2.2.0, < 2.3.0
pycodestyle >= 2.5.0, < 2.6.0
mccabe >= 0.6.0, < 0.7.0
enum34; python_version<"3.4"

View file

@ -26,6 +26,21 @@ FLAKE8_PYFLAKES_CODES = {
"ImportStarUsage": "F405",
"ImportStarNotPermitted": "F406",
"FutureFeatureNotDefined": "F407",
"PercentFormatInvalidFormat": "F501",
"PercentFormatExpectedMapping": "F502",
"PercentFormatExpectedSequence": "F503",
"PercentFormatExtraNamedArguments": "F504",
"PercentFormatMissingArgument": "F505",
"PercentFormatMixedPositionalAndNamed": "F506",
"PercentFormatPositionalCountMismatch": "F507",
"PercentFormatStarRequiresSequence": "F508",
"PercentFormatUnsupportedFormatCharacter": "F509",
"StringDotFormatInvalidFormat": "F521",
"StringDotFormatExtraNamedArguments": "F522",
"StringDotFormatExtraPositionalArguments": "F523",
"StringDotFormatMissingArgument": "F524",
"StringDotFormatMixingAutomatic": "F525",
"FStringMissingPlaceholders": "F541",
"MultiValueRepeatedKeyLiteral": "F601",
"MultiValueRepeatedKeyVariable": "F602",
"TooManyExpressionsInStarredAssignment": "F621",
@ -33,6 +48,7 @@ FLAKE8_PYFLAKES_CODES = {
"AssertTuple": "F631",
"IsLiteral": "F632",
"InvalidPrintSyntax": "F633",
"IfTuple": "F634",
"BreakOutsideLoop": "F701",
"ContinueOutsideLoop": "F702",
"ContinueInFinally": "F703",