From da4870266e07feed8488e805f4f94b806609900d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:37:52 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v5.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.1.7 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.7...v0.9.1) - [github.com/pre-commit/mirrors-mypy: v1.7.1 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.1...v1.14.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index df8e78c..3094ead 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.5.0 + rev: v5.0.0 hooks: - id: check-json - id: check-yaml @@ -19,13 +19,13 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.7 + rev: v0.9.1 hooks: - id: ruff args: ["--fix", "--show-fixes"] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.1 + rev: v1.14.1 hooks: - id: mypy From 6115b27ec05c174300d0a06e09f7326ebcbfc7e6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:38:42 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- sphinx_external_toc/_compat.py | 1 + sphinx_external_toc/api.py | 1 + sphinx_external_toc/events.py | 1 + sphinx_external_toc/parsing.py | 1 + tests/test_parsing.py | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sphinx_external_toc/_compat.py b/sphinx_external_toc/_compat.py index c87fb83..88275bc 100644 --- a/sphinx_external_toc/_compat.py +++ b/sphinx_external_toc/_compat.py @@ -1,4 +1,5 @@ """Compatibility for using dataclasses instead of attrs.""" + from __future__ import annotations import dataclasses as dc diff --git a/sphinx_external_toc/api.py b/sphinx_external_toc/api.py index 3bd8155..eb742a6 100644 --- a/sphinx_external_toc/api.py +++ b/sphinx_external_toc/api.py @@ -1,4 +1,5 @@ """Defines the `SiteMap` object, for storing the parsed ToC.""" + from collections.abc import MutableMapping from dataclasses import asdict, dataclass from typing import Any, Dict, Iterator, List, Optional, Set, Union diff --git a/sphinx_external_toc/events.py b/sphinx_external_toc/events.py index 8d468f4..9603b2b 100644 --- a/sphinx_external_toc/events.py +++ b/sphinx_external_toc/events.py @@ -1,4 +1,5 @@ """Sphinx event functions and directives.""" + import glob from pathlib import Path, PurePosixPath from typing import Any, List, Optional, Set diff --git a/sphinx_external_toc/parsing.py b/sphinx_external_toc/parsing.py index 717b9fa..82b8046 100644 --- a/sphinx_external_toc/parsing.py +++ b/sphinx_external_toc/parsing.py @@ -1,4 +1,5 @@ """Parse the ToC to a `SiteMap` object.""" + from collections.abc import Mapping from dataclasses import dataclass, fields from pathlib import Path diff --git a/tests/test_parsing.py b/tests/test_parsing.py index 57644f3..a53248f 100644 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -36,7 +36,7 @@ def test_create_toc_dict(path: Path, data_regression): "items_in_glob.yml": "entry contains incompatible keys 'glob' and 'entries' @ '/entries/0'", "no_root.yml": "'root' key not found @ '/'", "unknown_keys_nested.yml": ( - "Unknown keys found: {'unknown'}, allow.* " "@ '/subtrees/0/entries/1/'" + "Unknown keys found: {'unknown'}, allow.* @ '/subtrees/0/entries/1/'" ), "empty_subtrees.yml": "'subtrees' not a non-empty list @ '/'", "items_in_url.yml": "entry contains incompatible keys 'url' and 'entries' @ '/entries/0'",