Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#625)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
  • Loading branch information
pre-commit-ci[bot] and chrisjsewell committed Dec 5, 2022
1 parent 11756a1 commit e5c844d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ exclude: >
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
rev: v3.2.2
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand All @@ -31,12 +31,12 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -45,7 +45,7 @@ repos:
# - flake8-self~=0.2.2

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v0.991
hooks:
- id: mypy
args: [--config-file=pyproject.toml]
Expand Down
4 changes: 2 additions & 2 deletions myst_parser/mocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, renderer: DocutilsRenderer):

if not hasattr(self.reporter, "get_source_and_line"):
# In docutils this is set by `RSTState.runtime_init`
self.reporter.get_source_and_line = lambda l: (self.document["source"], l)
self.reporter.get_source_and_line = lambda li: (self.document["source"], li)

self.rfc_url = "rfc%d.html"

Expand Down Expand Up @@ -458,7 +458,7 @@ def run(self) -> list[nodes.Element]:
try:
self.renderer.document["source"] = str(path)
self.renderer.reporter.source = str(path)
self.renderer.reporter.get_source_and_line = lambda l: (str(path), l)
self.renderer.reporter.get_source_and_line = lambda li: (str(path), li)
if "relative-images" in self.options:
self.renderer.md_env["relative-images"] = os.path.relpath(
path.parent, source_dir
Expand Down
6 changes: 3 additions & 3 deletions myst_parser/sphinx_ext/myst_refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def resolve_myst_ref(
``[**nested**](reference)``
"""
target = node["reftarget"] # type: str
results = [] # type: List[Tuple[str, Element]]
target: str = node["reftarget"]
results: List[Tuple[str, Element]] = []

res_anchor = self._resolve_anchor(node, refdoc)
if res_anchor:
Expand Down Expand Up @@ -205,7 +205,7 @@ def _resolve_anchor(
if self.env.config.myst_heading_anchors is None:
# no target anchors will have been created, so we don't look for them
return None
target = node["reftarget"] # type: str
target: str = node["reftarget"]
if "#" not in target:
return None
# the link may be a heading anchor; we need to first get the relative path
Expand Down

0 comments on commit e5c844d

Please sign in to comment.