Skip to content

Commit

Permalink
Run pre-commit autoupdate (#107)
Browse files Browse the repository at this point in the history
* Run pre-commit autoupdate

* Fix pre-commit
  • Loading branch information
hoodmane authored Oct 1, 2023
1 parent 2b4b289 commit a849633
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.241"
rev: "v0.0.291"
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/psf/black
rev: "22.12.0"
rev: "23.9.1"
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.6"
rev: "v3.0.3"
hooks:
- id: prettier

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.9.0"
rev: "v1.10.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.2"
rev: "v2.2.5"
hooks:
- id: codespell

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.991"
rev: "v1.5.1"
hooks:
- id: mypy
exclude: (tests/)
Expand Down
1 change: 0 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def tests(session: Session) -> None:
@nox.session(python=["3.11"])
@nox.parametrize("typedoc", ["0.25"])
def test_typedoc(session: Session, typedoc: str) -> None:

session.install("-r", "requirements_dev.txt")
venvroot = Path(session.bin).parent
(venvroot / "node_modules").mkdir()
Expand Down
9 changes: 5 additions & 4 deletions sphinx_js/renderers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import textwrap
from collections.abc import Callable, Iterator
from collections.abc import Callable, Iterable, Iterator
from functools import partial
from re import sub
from typing import Any, Literal, Iterable
from typing import Any, Literal

from docutils.nodes import Node
from docutils.parsers.rst import Directive
Expand Down Expand Up @@ -209,8 +209,9 @@ def get_object(self) -> TopLevel:
)
except SuffixAmbiguous as exc:
raise SphinxError(
'More than one object matches the path suffix "%s". Candidate paths have these segments in front: %s'
% ("".join(exc.segments), exc.next_possible_keys)
'More than one object matches the path suffix "{}". Candidate paths have these segments in front: {}'.format(
"".join(exc.segments), exc.next_possible_keys
)
)

def dependencies(self) -> set[str]:
Expand Down
6 changes: 3 additions & 3 deletions sphinx_js/typedoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def typedoc_output(

def parse(json: dict[str, Any]) -> "Project":
try:
return Project.parse_obj(json) # type:ignore[no-any-return]
return Project.parse_obj(json)
except ValidationError as exc:
fix_exc_errors(json, exc)
raise
Expand Down Expand Up @@ -359,7 +359,7 @@ class MemberProperties(TypedDict):
class Base(BaseModel):
children: Sequence["Node"] = []
path: list[str] = []
id: int | None
id: int | None = None
kindString: str = ""
sources: list[Source] = []
filepath: list[str] = []
Expand Down Expand Up @@ -814,7 +814,7 @@ def comment(self) -> Comment:
return self.type.declaration.comment
return DEFAULT_COMMENT

defaultValue: str | None
defaultValue: str | None = None
flags: Flags
name: str
type: "TypeD"
Expand Down
1 change: 0 additions & 1 deletion tests/test_renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def test_func_render_shortnames(function_render):


def test_func_render_flags(function_render):

# is_abstract is ignored? Maybe only makes sense if it is a class method??
# TODO: look into this.
assert function_render(is_abstract=True) == DEFAULT_RESULT
Expand Down
1 change: 0 additions & 1 deletion tests/test_typedoc_analysis/test_typedoc_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ def test_utility_types(self):
]

def test_constrained_by_property(self):

obj = self.analyzer.get_object(["objProps"])
assert obj.params[0].type == [
"{ ",
Expand Down

0 comments on commit a849633

Please sign in to comment.