Skip to content

Commit 8b758cd

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

17 files changed

Lines changed: 36 additions & 35 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def parse_directive_text(
191191
```python
192192
import pytest
193193

194+
194195
@pytest.mark.sphinx(
195196
buildername="html",
196197
srcdir="path/to/sourcedir",

‎docs/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ myst_html_meta = {
8888
"description lang=en": "metadata description",
8989
"description lang=fr": "description des métadonnées",
9090
"keywords": "Sphinx, MyST",
91-
"property=og:locale": "en_US"
91+
"property=og:locale": "en_US",
9292
}
9393
```
9494

‎docs/develop/test_infrastructure.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ For example, after writing:
2727

2828
```python
2929
def test_example_dict(data_regression):
30-
data_regression.check({
31-
"key1": "value1",
32-
"key2": "value2",
33-
"more": "data...",
34-
})
30+
data_regression.check(
31+
{
32+
"key1": "value1",
33+
"key2": "value2",
34+
"more": "data...",
35+
}
36+
)
37+
38+
3539
def test_example_str(file_regression):
3640
file_regression.check("a very long string...")
3741
```

‎docs/intro.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ Next, add it to your list of extensions in `conf.py`:
140140

141141
```python
142142
extensions = [
143-
"myst_parser",
144-
"sphinx_design",
143+
"myst_parser",
144+
"sphinx_design",
145145
]
146146
```
147147

‎docs/syntax/code_and_apis.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This language is used to determine the syntax highlighting, using an available [
99
:::{syntax-example}
1010
```python
1111
from a import b
12+
1213
c = "string"
1314
```
1415
:::

‎docs/syntax/optional.md‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,7 @@ Key differences:
332332
Adding `"substitution"` to `myst_enable_extensions` (in the {{ confpy }}) will allow you to add substitutions, added in either the `conf.py` using `myst_substitutions`:
333333

334334
```python
335-
myst_substitutions = {
336-
"key1": "I'm a **substitution**"
337-
}
335+
myst_substitutions = {"key1": "I'm a **substitution**"}
338336
```
339337

340338
or at the top of the file, in the front-matter section (see [this section](syntax/frontmatter)):

‎myst_parser/_docs.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ def run(self):
404404
### MyST Lexer ###
405405
# TODO when some more work and testing, this should be made available publicly
406406

407-
from pygments import token # noqa: E402
408-
from pygments.lexer import bygroups, inherit, this, using # noqa: E402
409-
from pygments.lexers.markup import MarkdownLexer # noqa: E402
407+
from pygments import token
408+
from pygments.lexer import bygroups, inherit, this, using
409+
from pygments.lexers.markup import MarkdownLexer
410410

411411

412412
class MystLexer(MarkdownLexer):

‎myst_parser/inventory.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def filter_string(
411411

412412

413413
def fetch_inventory(
414-
uri: str, *, timeout: None | float = None, base_url: None | str = None
414+
uri: str, *, timeout: float | None = None, base_url: str | None = None
415415
) -> InventoryType:
416416
"""Fetch an inventory from a URL or local path."""
417417
if uri.startswith(("http://", "https://")):
@@ -421,7 +421,7 @@ def fetch_inventory(
421421
return load(stream, base_url=base_url)
422422

423423

424-
def inventory_cli(inputs: None | list[str] = None):
424+
def inventory_cli(inputs: list[str] | None = None):
425425
"""Command line interface for fetching and parsing an inventory."""
426426
parser = argparse.ArgumentParser(description="Parse an inventory file.")
427427
parser.add_argument("uri", metavar="[URL|PATH]", help="URI of the inventory file")

‎myst_parser/mdit_to_docutils/base.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(self, parser: MarkdownIt) -> None:
112112
if k.startswith("render_") and k != "render_children"
113113
}
114114
# these are lazy loaded, when needed
115-
self._inventories: None | dict[str, inventory.InventoryType] = None
115+
self._inventories: dict[str, inventory.InventoryType] | None = None
116116

117117
def __getattr__(self, name: str):
118118
"""Warn when the renderer has not been setup yet."""
@@ -300,7 +300,7 @@ def nested_render_text(
300300
text: str,
301301
lineno: int,
302302
inline: bool = False,
303-
temp_root_node: None | nodes.Element = None,
303+
temp_root_node: nodes.Element | None = None,
304304
heading_offset: int = 0,
305305
) -> None:
306306
"""Render unparsed text (appending to the current node).
@@ -988,7 +988,7 @@ def render_link(self, token: SyntaxTreeNode) -> None:
988988
return self.render_link_unknown(token)
989989

990990
def render_link_url(
991-
self, token: SyntaxTreeNode, conversion: None | UrlSchemeType = None
991+
self, token: SyntaxTreeNode, conversion: UrlSchemeType | None = None
992992
) -> None:
993993
"""Render link token (including autolink and linkify),
994994
where the link has been identified as an external URL.
@@ -2113,7 +2113,7 @@ def default_slugify(title: str) -> str:
21132113
def compute_unique_slug(
21142114
token_tree: SyntaxTreeNode,
21152115
slugs: Container[str],
2116-
slug_func: None | Callable[[str], str] = None,
2116+
slug_func: Callable[[str], str] | None = None,
21172117
) -> str:
21182118
"""Compute the slug for a heading token, unique against existing slugs."""
21192119
slug_func = github_slugify if slug_func is None else slug_func

‎myst_parser/mdit_to_docutils/sphinx_.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def render_link_unknown(self, token: SyntaxTreeNode) -> None:
136136
path_dest, *_path_ids = destination.split("#", maxsplit=1)
137137
path_id = _path_ids[0] if _path_ids else None
138138

139-
potential_path: None | Path = None
139+
potential_path: Path | None = None
140140
if self.sphinx_env.srcdir: # not set in some test situations
141141
_, path_str = self.sphinx_env.relfn2path(path_dest, self.sphinx_env.docname)
142142
potential_path = Path(path_str)

0 commit comments

Comments
 (0)