Skip to content

Commit 5144313

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1afae29 commit 5144313

File tree

5 files changed

+27
-18
lines changed

5 files changed

+27
-18
lines changed

sphinx_js/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ def analyze(app: Sphinx) -> None:
8080
)
8181
abs_source_paths = [normpath(join(app.confdir, path)) for path in source_paths]
8282
root_for_relative_paths = root_or_fallback(
83-
normpath(join(app.confdir, app.config.root_for_relative_js_paths))
84-
if app.config.root_for_relative_js_paths
85-
else None,
83+
(
84+
normpath(join(app.confdir, app.config.root_for_relative_js_paths))
85+
if app.config.root_for_relative_js_paths
86+
else None
87+
),
8688
abs_source_paths,
8789
)
8890

sphinx_js/analyzer_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def make(self) -> list[str]:
5858

5959

6060
def cache_to_file(
61-
get_filename: Callable[..., str | None]
61+
get_filename: Callable[..., str | None],
6262
) -> Callable[[Callable[P, T]], Callable[P, T]]:
6363
"""Return a decorator that will cache the result of ``get_filename()`` to a
6464
file

sphinx_js/directives.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
can access each other and collaborate.
88
99
"""
10+
1011
import re
1112
from collections.abc import Iterable
1213
from functools import cache

sphinx_js/jsdoc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
then lazily constitute IR objects as requested.
55
66
"""
7+
78
import pathlib
89
import subprocess
910
from collections import defaultdict
@@ -175,9 +176,10 @@ def _doclet_as_class(self, doclet: Doclet, full_path: Sequence[str]) -> Class:
175176
kind = member_doclet.get("kind")
176177
member_full_path = full_path_segments(member_doclet, self._base_dir)
177178
# Typedefs should still fit into function-shaped holes:
178-
doclet_as_whatever: Callable[[Doclet, list[str]], Function] | Callable[
179-
[Doclet, list[str]], Attribute
180-
] = (
179+
doclet_as_whatever: (
180+
Callable[[Doclet, list[str]], Function]
181+
| Callable[[Doclet, list[str]], Attribute]
182+
) = (
181183
self._doclet_as_function
182184
if (kind == "function" or kind == "typedef")
183185
else self._doclet_as_attribute

sphinx_js/renderers.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -619,21 +619,25 @@ def _template_vars(self, name: str, obj: Class | Interface) -> dict[str, Any]:
619619
exported_from=obj.exported_from,
620620
class_comment=render_description(obj.description),
621621
is_abstract=isinstance(obj, Class) and obj.is_abstract,
622-
interfaces=[self.render_type(x) for x in obj.interfaces]
623-
if isinstance(obj, Class)
624-
else [],
622+
interfaces=(
623+
[self.render_type(x) for x in obj.interfaces]
624+
if isinstance(obj, Class)
625+
else []
626+
),
625627
is_interface=isinstance(obj, Interface),
626628
supers=[self.render_type(x) for x in obj.supers],
627629
constructor_comment=render_description(constructor.description),
628630
content="\n".join(self._content),
629-
members=self._members_of(
630-
obj,
631-
include=self._options["members"],
632-
exclude=self._options.get("exclude-members", set()),
633-
should_include_private="private-members" in self._options,
634-
)
635-
if "members" in self._options
636-
else "",
631+
members=(
632+
self._members_of(
633+
obj,
634+
include=self._options["members"],
635+
exclude=self._options.get("exclude-members", set()),
636+
should_include_private="private-members" in self._options,
637+
)
638+
if "members" in self._options
639+
else ""
640+
),
637641
)
638642

639643
def _members_of(

0 commit comments

Comments
 (0)