Fixed formatting

This commit is contained in:
Ashley Whetter 2019-10-05 16:09:26 -07:00
parent b8fddf9c0b
commit 520f3b0469
7 changed files with 12 additions and 12 deletions

View File

@ -53,7 +53,9 @@ class AutoapiSummary(Directive): # pylint: disable=too-few-public-methods
docname = posixpath.join(tree_prefix, obj.name)
docname = posixpath.normpath(posixpath.join(dirname, docname))
if docname not in env.found_docs:
self.reporter.warning("toctree references unknown document {}".format(docname))
self.reporter.warning(
"toctree references unknown document {}".format(docname)
)
docnames.append(docname)
tocnode = addnodes.toctree()

View File

@ -14,6 +14,7 @@ from .mappers.python import (
# pylint: disable=attribute-defined-outside-init,no-self-use,unused-argument
class AutoapiDocumenter(autodoc.Documenter):
def get_attr(self, obj, name, *defargs):
if hasattr(self.env.app, "registry") and hasattr(

View File

@ -46,8 +46,7 @@ def run_autoapi(app): # pylint: disable=too-many-branches
"Invalid autoapi_type setting, "
"following values is allowed: {}".format(
", ".join(
'"{}"'.format(api_type)
for api_type in sorted(LANGUAGE_MAPPERS)
'"{}"'.format(api_type) for api_type in sorted(LANGUAGE_MAPPERS)
)
)
)

View File

@ -172,12 +172,7 @@ class DotNetSphinxMapper(SphinxMapperBase):
except KeyError:
LOGGER.warning("Unknown type: %s" % data)
else:
obj = cls(
data,
jinja_env=self.jinja_env,
options=options,
**kwargs
)
obj = cls(data, jinja_env=self.jinja_env, options=options, **kwargs)
obj.url_root = self.url_root
# Append child objects

View File

@ -109,7 +109,6 @@ class JavaScriptPythonMapper(PythonMapperBase):
)
class JavaScriptClass(JavaScriptPythonMapper):
type = "class"
ref_directive = "class"

View File

@ -17,7 +17,9 @@ class Parser(object):
def _decode(self, to_decode):
if sys.version_info < (3,) and self._encoding:
try:
return unicode(to_decode, self._encoding) # pylint: disable=undefined-variable
return unicode(
to_decode, self._encoding
) # pylint: disable=undefined-variable
except TypeError:
# The string was already in the correct format
pass

View File

@ -92,7 +92,9 @@ class DotNetObjectTests(unittest.TestCase):
def test_class_namespace(self):
"""Class parent resolution"""
cls = dotnet.DotNetClass(dict(id="Foo.Bar.Widget", type="class"), jinja_env=None)
cls = dotnet.DotNetClass(
dict(id="Foo.Bar.Widget", type="class"), jinja_env=None
)
self.assertEqual(cls.namespace, "Foo.Bar")
cls = dotnet.DotNetClass(dict(id="Foo.Bar", type="class"), jinja_env=None)
self.assertEqual(cls.namespace, "Foo")