From 520f3b0469c31787c50a4992693f2a6698807fd6 Mon Sep 17 00:00:00 2001 From: Ashley Whetter Date: Sat, 5 Oct 2019 16:09:26 -0700 Subject: [PATCH] Fixed formatting --- autoapi/directives.py | 4 +++- autoapi/documenters.py | 1 + autoapi/extension.py | 3 +-- autoapi/mappers/dotnet.py | 7 +------ autoapi/mappers/javascript.py | 1 - autoapi/mappers/python/parser.py | 4 +++- tests/test_objects.py | 4 +++- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/autoapi/directives.py b/autoapi/directives.py index cc62a69..b8411d2 100644 --- a/autoapi/directives.py +++ b/autoapi/directives.py @@ -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() diff --git a/autoapi/documenters.py b/autoapi/documenters.py index 0cb7f10..8d7b69c 100644 --- a/autoapi/documenters.py +++ b/autoapi/documenters.py @@ -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( diff --git a/autoapi/extension.py b/autoapi/extension.py index d87fc0c..032a929 100644 --- a/autoapi/extension.py +++ b/autoapi/extension.py @@ -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) ) ) ) diff --git a/autoapi/mappers/dotnet.py b/autoapi/mappers/dotnet.py index c9ce388..4609798 100644 --- a/autoapi/mappers/dotnet.py +++ b/autoapi/mappers/dotnet.py @@ -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 diff --git a/autoapi/mappers/javascript.py b/autoapi/mappers/javascript.py index 0ecbf5b..368c0e4 100644 --- a/autoapi/mappers/javascript.py +++ b/autoapi/mappers/javascript.py @@ -109,7 +109,6 @@ class JavaScriptPythonMapper(PythonMapperBase): ) - class JavaScriptClass(JavaScriptPythonMapper): type = "class" ref_directive = "class" diff --git a/autoapi/mappers/python/parser.py b/autoapi/mappers/python/parser.py index 8564c08..3487a49 100644 --- a/autoapi/mappers/python/parser.py +++ b/autoapi/mappers/python/parser.py @@ -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 diff --git a/tests/test_objects.py b/tests/test_objects.py index 5ce0716..cecc02a 100644 --- a/tests/test_objects.py +++ b/tests/test_objects.py @@ -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")