diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-14 07:47:10 -0500 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-14 07:47:10 -0500 |
| commit | 911c69f0fd36db3b2e1fb0131d443208d21991b9 (patch) | |
| tree | 8283e26658f8e4daae7e3e5a4c0de020277dd217 /src/flake8/api | |
| parent | dc05fce516e7de8153e69a8c3e648c1ce03b890a (diff) | |
| download | flake8-911c69f0fd36db3b2e1fb0131d443208d21991b9.tar.gz | |
Fix up docstrings and __all__ in api.legacy
If users do `from flake8.api.legacy import *` we only want them to get
get_style_guide imported. The other classes are not meant to be created
by users.
Diffstat (limited to 'src/flake8/api')
| -rw-r--r-- | src/flake8/api/legacy.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/flake8/api/legacy.py b/src/flake8/api/legacy.py index 883f0f6..a6c3b6a 100644 --- a/src/flake8/api/legacy.py +++ b/src/flake8/api/legacy.py @@ -1,4 +1,8 @@ -"""Module containing shims around Flake8 2.0 behaviour.""" +"""Module containing shims around Flake8 2.x behaviour. + +Previously, users would import :func:`get_style_guide` from ``flake8.engine``. +In 3.0 we no longer have an "engine" module but we maintain the API from it. +""" import logging import os.path @@ -8,8 +12,19 @@ from flake8.main import application as app LOG = logging.getLogger(__name__) +__all__ = ('get_style_guide',) + + def get_style_guide(**kwargs): - """Stub out the only function I'm aware of people using.""" + """Provision a StyleGuide for use. + + :param \*\*kwargs: + Keyword arguments that provide some options for the StyleGuide. + :returns: + An initialized StyleGuide + :rtype: + :class:`StyleGuide` + """ application = app.Application() application.find_plugins() application.register_plugin_options() |
