mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-11 07:14:18 +00:00
Remove pyflakes monkeypatching
This commit is contained in:
parent
684ffb3306
commit
a252a0b138
1 changed files with 1 additions and 11 deletions
|
|
@ -53,16 +53,6 @@ FLAKE8_PYFLAKES_CODES = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def patch_pyflakes():
|
|
||||||
"""Add error codes to Pyflakes messages."""
|
|
||||||
for name, obj in vars(pyflakes.messages).items():
|
|
||||||
if name[0].isupper() and obj.message:
|
|
||||||
obj.flake8_code = FLAKE8_PYFLAKES_CODES.get(name, "F999")
|
|
||||||
|
|
||||||
|
|
||||||
patch_pyflakes()
|
|
||||||
|
|
||||||
|
|
||||||
class FlakesChecker(pyflakes.checker.Checker):
|
class FlakesChecker(pyflakes.checker.Checker):
|
||||||
"""Subclass the Pyflakes checker to conform with the flake8 API."""
|
"""Subclass the Pyflakes checker to conform with the flake8 API."""
|
||||||
|
|
||||||
|
|
@ -186,7 +176,7 @@ class FlakesChecker(pyflakes.checker.Checker):
|
||||||
message.lineno,
|
message.lineno,
|
||||||
col,
|
col,
|
||||||
"{} {}".format(
|
"{} {}".format(
|
||||||
message.flake8_code,
|
FLAKE8_PYFLAKES_CODES.get(type(message).__name__, "F999"),
|
||||||
message.message % message.message_args,
|
message.message % message.message_args,
|
||||||
),
|
),
|
||||||
message.__class__,
|
message.__class__,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue