From 911c69f0fd36db3b2e1fb0131d443208d21991b9 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Thu, 14 Jul 2016 07:47:10 -0500 Subject: [PATCH] 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. --- src/flake8/api/legacy.py | 19 +++++++++++++++++-- 1 file 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()