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.
This commit is contained in:
Ian Cordasco 2016-07-14 07:47:10 -05:00
parent dc05fce516
commit 911c69f0fd
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A

View file

@ -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()