diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d1d68f3..1d14516 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ exclude: > repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-json - id: check-yaml @@ -19,14 +19,14 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.5 + rev: v0.11.5 hooks: - id: ruff args: [--fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.1 + rev: v1.15.0 hooks: - id: mypy additional_dependencies: [] diff --git a/sphinx_design/cards.py b/sphinx_design/cards.py index da522f5..18ebbd1 100644 --- a/sphinx_design/cards.py +++ b/sphinx_design/cards.py @@ -85,7 +85,7 @@ def create_card( # noqa: PLR0915 # TODO better degradation for latex card_classes = ["sd-card", "sd-sphinx-override"] if "width" in options: - card_classes += [f'sd-w-{options["width"].rstrip("%")}'] + card_classes += [f"sd-w-{options['width'].rstrip('%')}"] card_classes += options.get("margin", ["sd-mb-3"]) card_classes += [f"sd-shadow-{options.get('shadow', 'sm')}"] if "link" in options: diff --git a/sphinx_design/grids.py b/sphinx_design/grids.py index 3614822..bfc3c60 100644 --- a/sphinx_design/grids.py +++ b/sphinx_design/grids.py @@ -191,7 +191,7 @@ def run_with_defaults(self) -> list[nodes.Node]: + self.options.get("margin", []) + self.options.get("padding", []) + ( - [f'sd-align-major-{self.options["child-align"]}'] + [f"sd-align-major-{self.options['child-align']}"] if "child-align" in self.options else [] ) diff --git a/tests/test_snippets.py b/tests/test_snippets.py index e47bea7..b15768a 100644 --- a/tests/test_snippets.py +++ b/tests/test_snippets.py @@ -45,7 +45,7 @@ def test_snippets_rst( doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1 file_regression.check( doctree.pformat(), - basename=f"snippet_pre_{path.name[:-len(path.suffix)]}", + basename=f"snippet_pre_{path.name[: -len(path.suffix)]}", extension=".xml", encoding="utf8", ) @@ -70,7 +70,7 @@ def test_snippets_myst( doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1 file_regression.check( doctree.pformat(), - basename=f"snippet_pre_{path.name[:-len(path.suffix)]}", + basename=f"snippet_pre_{path.name[: -len(path.suffix)]}", extension=".xml", encoding="utf8", ) @@ -94,7 +94,7 @@ def test_snippets_rst_post( doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1 file_regression.check( doctree.pformat(), - basename=f"snippet_post_{path.name[:-len(path.suffix)]}", + basename=f"snippet_post_{path.name[: -len(path.suffix)]}", extension=".xml", encoding="utf8", ) @@ -119,7 +119,7 @@ def test_snippets_myst_post( doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1 file_regression.check( doctree.pformat(), - basename=f"snippet_post_{path.name[:-len(path.suffix)]}", + basename=f"snippet_post_{path.name[: -len(path.suffix)]}", extension=".xml", encoding="utf8", )