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:
Ian Cordasco 2016-07-30 06:42:34 -05:00
parent b02855769b
commit 22650e5086
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
2 changed files with 6 additions and 0 deletions

View file

@ -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