summaryrefslogtreecommitdiff
path: root/src/flake8
diff options
context:
space:
mode:
authorEric N. Vander Weele <ericvw@gmail.com>2019-10-01 08:48:18 +0200
committerEric N. Vander Weele <ericvw@gmail.com>2019-10-01 08:48:18 +0200
commit55ef2c6f5eae1617dcbbb51636e9280aa8870e02 (patch)
tree10b28fe17c309caa070773131d2ed149d0595949 /src/flake8
parent6043e908552cd38a75098c99a739497744170e81 (diff)
downloadflake8-55ef2c6f5eae1617dcbbb51636e9280aa8870e02.tar.gz
application: Pass returned prelim options to `.configure_logging()`
The verbosity and output file options can be obtained from options returned by `.parse_preliminary_options_and_args()`, instead of state from the `Application` object.
Diffstat (limited to 'src/flake8')
-rw-r--r--src/flake8/api/legacy.py6
-rw-r--r--src/flake8/main/application.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/flake8/api/legacy.py b/src/flake8/api/legacy.py
index 16a33f4..6cff7ad 100644
--- a/src/flake8/api/legacy.py
+++ b/src/flake8/api/legacy.py
@@ -28,10 +28,10 @@ def get_style_guide(**kwargs):
:class:`StyleGuide`
"""
application = app.Application()
- application.parse_preliminary_options_and_args([])
- flake8.configure_logging(
- application.prelim_opts.verbose, application.prelim_opts.output_file
+ prelim_opts, prelim_args = application.parse_preliminary_options_and_args(
+ []
)
+ flake8.configure_logging(prelim_opts.verbose, prelim_opts.output_file)
application.make_config_finder()
application.find_plugins()
application.register_plugin_options()
diff --git a/src/flake8/main/application.py b/src/flake8/main/application.py
index 65a17d5..dc0f237 100644
--- a/src/flake8/main/application.py
+++ b/src/flake8/main/application.py
@@ -357,10 +357,10 @@ class Application(object):
"""
# NOTE(sigmavirus24): When updating this, make sure you also update
# our legacy API calls to these same methods.
- self.parse_preliminary_options_and_args(argv)
- flake8.configure_logging(
- self.prelim_opts.verbose, self.prelim_opts.output_file
+ prelim_opts, prelim_args = self.parse_preliminary_options_and_args(
+ argv
)
+ flake8.configure_logging(prelim_opts.verbose, prelim_opts.output_file)
self.make_config_finder()
self.find_plugins()
self.register_plugin_options()