mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
Merge pull request #1540 from asottile/unused-param
remove unused parameter from make_formatter
This commit is contained in:
commit
69eb576dd5
3 changed files with 3 additions and 7 deletions
|
|
@ -158,8 +158,7 @@ class StyleGuide:
|
|||
"Report should be subclass of "
|
||||
"flake8.formatter.BaseFormatter."
|
||||
)
|
||||
self._application.formatter = None
|
||||
self._application.make_formatter(reporter)
|
||||
self._application.formatter = reporter(self.options)
|
||||
self._application.guide = None
|
||||
# NOTE(sigmavirus24): This isn't the intended use of
|
||||
# Application#make_guide but it works pretty well.
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ from typing import Optional
|
|||
from typing import Sequence
|
||||
from typing import Set
|
||||
from typing import Tuple
|
||||
from typing import Type
|
||||
|
||||
import flake8
|
||||
from flake8 import checker
|
||||
|
|
@ -183,9 +182,7 @@ class Application:
|
|||
except TypeError:
|
||||
parse_options(self.options)
|
||||
|
||||
def make_formatter(
|
||||
self, formatter_class: Optional[Type[BaseFormatter]] = None
|
||||
) -> None:
|
||||
def make_formatter(self) -> None:
|
||||
"""Initialize a formatter based on the parsed options."""
|
||||
assert self.plugins is not None
|
||||
assert self.options is not None
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ def test_styleguide_init_report():
|
|||
raise NotImplementedError
|
||||
|
||||
style_guide.init_report(FakeFormatter)
|
||||
app.make_formatter.assert_called_once_with(FakeFormatter)
|
||||
assert isinstance(app.formatter, FakeFormatter)
|
||||
assert app.guide is None
|
||||
app.make_guide.assert_called_once_with()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue