mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-08 05:54:17 +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 "
|
"Report should be subclass of "
|
||||||
"flake8.formatter.BaseFormatter."
|
"flake8.formatter.BaseFormatter."
|
||||||
)
|
)
|
||||||
self._application.formatter = None
|
self._application.formatter = reporter(self.options)
|
||||||
self._application.make_formatter(reporter)
|
|
||||||
self._application.guide = None
|
self._application.guide = None
|
||||||
# NOTE(sigmavirus24): This isn't the intended use of
|
# NOTE(sigmavirus24): This isn't the intended use of
|
||||||
# Application#make_guide but it works pretty well.
|
# Application#make_guide but it works pretty well.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ from typing import Optional
|
||||||
from typing import Sequence
|
from typing import Sequence
|
||||||
from typing import Set
|
from typing import Set
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
from typing import Type
|
|
||||||
|
|
||||||
import flake8
|
import flake8
|
||||||
from flake8 import checker
|
from flake8 import checker
|
||||||
|
|
@ -183,9 +182,7 @@ class Application:
|
||||||
except TypeError:
|
except TypeError:
|
||||||
parse_options(self.options)
|
parse_options(self.options)
|
||||||
|
|
||||||
def make_formatter(
|
def make_formatter(self) -> None:
|
||||||
self, formatter_class: Optional[Type[BaseFormatter]] = None
|
|
||||||
) -> None:
|
|
||||||
"""Initialize a formatter based on the parsed options."""
|
"""Initialize a formatter based on the parsed options."""
|
||||||
assert self.plugins is not None
|
assert self.plugins is not None
|
||||||
assert self.options is not None
|
assert self.options is not None
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ def test_styleguide_init_report():
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
style_guide.init_report(FakeFormatter)
|
style_guide.init_report(FakeFormatter)
|
||||||
app.make_formatter.assert_called_once_with(FakeFormatter)
|
assert isinstance(app.formatter, FakeFormatter)
|
||||||
assert app.guide is None
|
assert app.guide is None
|
||||||
app.make_guide.assert_called_once_with()
|
app.make_guide.assert_called_once_with()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue