mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 18:46:52 +00:00
Reset Application.formatter attribute in init_report
For our Legacy API users, StyleGuide.init_report should reset the formatter attribute before calling Application.make_formatter(). Closes #200
This commit is contained in:
parent
b02855769b
commit
22650e5086
2 changed files with 6 additions and 0 deletions
|
|
@ -23,6 +23,9 @@
|
|||
- Fix issue where users were unable to ignore plugin errors that were on
|
||||
by default. (See also `GitLab#195`_)
|
||||
|
||||
- Fix our legacy API StyleGuide's ``init_report`` method to actually override
|
||||
the previous formatter. (See also `GitLab#200`_)
|
||||
|
||||
|
||||
.. links
|
||||
.. _GitLab#164:
|
||||
|
|
@ -35,5 +38,7 @@
|
|||
https://gitlab.com/pycqa/flake8/issues/193
|
||||
.. _GitLab#195:
|
||||
https://gitlab.com/pycqa/flake8/issues/195
|
||||
.. _GitLab#200:
|
||||
https://gitlab.com/pycqa/flake8/issues/200
|
||||
.. _this Python bug report:
|
||||
https://bugs.python.org/issue27649
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ class StyleGuide(object):
|
|||
if not issubclass(reporter, formatter.BaseFormatter):
|
||||
raise ValueError("Report should be subclass of "
|
||||
"flake8.formatter.BaseFormatter.")
|
||||
self._application.formatter = None
|
||||
self._application.make_formatter(reporter)
|
||||
self._application.guide = None
|
||||
# NOTE(sigmavirus24): This isn't the intended use of
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue