diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-07 17:39:02 -0500 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-07 17:39:02 -0500 |
| commit | 1372d0dd1c103077c53eb1977090c3065cac1992 (patch) | |
| tree | 3b3df7f5bcefed67224e7cfab296c3b16829869d | |
| parent | a4ce229fb6493c11fd8ed850d5c07a5964fade7d (diff) | |
| download | flake8-backwards-compat-api.tar.gz | |
Handle kwargs passed to get_style_guidebackwards-compat-api
| -rw-r--r-- | src/flake8/api/legacy.py | 10 |
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) |
