mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-13 08:04:18 +00:00
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:
parent
dc05fce516
commit
911c69f0fd
1 changed files with 17 additions and 2 deletions
|
|
@ -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 logging
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
|
|
@ -8,8 +12,19 @@ from flake8.main import application as app
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ('get_style_guide',)
|
||||||
|
|
||||||
|
|
||||||
def get_style_guide(**kwargs):
|
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 = app.Application()
|
||||||
application.find_plugins()
|
application.find_plugins()
|
||||||
application.register_plugin_options()
|
application.register_plugin_options()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue