Merge branch 'app-remove-cached-objects' into 'master'

application: Remove checks for properties being set previously

See merge request pycqa/flake8!379
This commit is contained in:
Anthony Sottile 2019-11-05 13:43:45 +00:00
commit 034f8823bc

View file

@ -162,19 +162,16 @@ class Application(object):
Determine whether to parse configuration files or not. (i.e., the Determine whether to parse configuration files or not. (i.e., the
--isolated option). --isolated option).
""" """
if self.local_plugins is None:
self.local_plugins = config.get_local_plugins( self.local_plugins = config.get_local_plugins(
self.config_finder, config_file, ignore_config_files self.config_finder, config_file, ignore_config_files
) )
sys.path.extend(self.local_plugins.paths) sys.path.extend(self.local_plugins.paths)
if self.check_plugins is None:
self.check_plugins = plugin_manager.Checkers( self.check_plugins = plugin_manager.Checkers(
self.local_plugins.extension self.local_plugins.extension
) )
if self.formatting_plugins is None:
self.formatting_plugins = plugin_manager.ReportFormatters( self.formatting_plugins = plugin_manager.ReportFormatters(
self.local_plugins.report self.local_plugins.report
) )
@ -196,7 +193,6 @@ class Application(object):
:param list argv: :param list argv:
Command-line arguments passed in directly. Command-line arguments passed in directly.
""" """
if self.options is None and self.args is None:
self.options, self.args = aggregator.aggregate_options( self.options, self.args = aggregator.aggregate_options(
self.option_manager, self.config_finder, argv self.option_manager, self.config_finder, argv
) )
@ -232,7 +228,6 @@ class Application(object):
def make_formatter(self, formatter_class=None): def make_formatter(self, formatter_class=None):
# type: (Optional[Type[BaseFormatter]]) -> None # type: (Optional[Type[BaseFormatter]]) -> None
"""Initialize a formatter based on the parsed options.""" """Initialize a formatter based on the parsed options."""
if self.formatter is None:
format_plugin = self.options.format format_plugin = self.options.format
if 1 <= self.options.quiet < 2: if 1 <= self.options.quiet < 2:
format_plugin = "quiet-filename" format_plugin = "quiet-filename"
@ -247,7 +242,6 @@ class Application(object):
def make_guide(self): def make_guide(self):
# type: () -> None # type: () -> None
"""Initialize our StyleGuide.""" """Initialize our StyleGuide."""
if self.guide is None:
self.guide = style_guide.StyleGuideManager( self.guide = style_guide.StyleGuideManager(
self.options, self.formatter self.options, self.formatter
) )
@ -258,7 +252,6 @@ class Application(object):
def make_file_checker_manager(self): def make_file_checker_manager(self):
# type: () -> None # type: () -> None
"""Initialize our FileChecker Manager.""" """Initialize our FileChecker Manager."""
if self.file_checker_manager is None:
self.file_checker_manager = checker.Manager( self.file_checker_manager = checker.Manager(
style_guide=self.guide, style_guide=self.guide,
arguments=self.args, arguments=self.args,