diff options
| author | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | 2019-02-17 15:22:44 +0000 |
|---|---|---|
| committer | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | 2019-02-17 15:22:44 +0000 |
| commit | 2170f54cb35d790dc30ef1687a03b599e17fab04 (patch) | |
| tree | bb17cba2a2d4615f52f16370acc94261dc564f8f /src/flake8 | |
| parent | 684ffb3306af89e4092c4598aa9ae4294eb52eb8 (diff) | |
| parent | a252a0b1386ee815833f2edae0ffa45aa23032ac (diff) | |
| download | flake8-2170f54cb35d790dc30ef1687a03b599e17fab04.tar.gz | |
Merge branch 'less_monkeypatch' into 'master'
Remove pyflakes monkeypatching
See merge request pycqa/flake8!306
Diffstat (limited to 'src/flake8')
| -rw-r--r-- | src/flake8/plugins/pyflakes.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/flake8/plugins/pyflakes.py b/src/flake8/plugins/pyflakes.py index d4556c5..2f233c4 100644 --- a/src/flake8/plugins/pyflakes.py +++ b/src/flake8/plugins/pyflakes.py @@ -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): """Subclass the Pyflakes checker to conform with the flake8 API.""" @@ -186,7 +176,7 @@ class FlakesChecker(pyflakes.checker.Checker): message.lineno, col, "{} {}".format( - message.flake8_code, + FLAKE8_PYFLAKES_CODES.get(type(message).__name__, "F999"), message.message % message.message_args, ), message.__class__, |
