summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/flake8/api/legacy.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/flake8/api/legacy.py b/src/flake8/api/legacy.py
index 42e83c3..35c7101 100644
--- a/src/flake8/api/legacy.py
+++ b/src/flake8/api/legacy.py
@@ -1,14 +1,24 @@
"""Module containing shims around Flake8 2.0 behaviour."""
+import logging
import os.path
from flake8.formatting import base as formatter
from flake8.main import application as app
+LOG = logging.getLogger(__name__)
+
def get_style_guide(**kwargs):
"""Stub out the only function I'm aware of people using."""
application = app.Application()
application.initialize([])
+ options = application.options
+ for key, value in kwargs.items():
+ try:
+ getattr(options, key)
+ setattr(options, key, value)
+ except AttributeError:
+ LOG.error('Could not update option "%s"', key)
return StyleGuide(application)