Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#82)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.5.0](pre-commit/pre-commit-hooks@v4.3.0...v4.5.0)
- [github.com/pycqa/isort: 5.10.1 → 5.12.0](PyCQA/isort@5.10.1...5.12.0)
- [github.com/psf/black: 22.6.0 → 23.10.0](psf/black@22.6.0...23.10.0)
- [github.com/PyCQA/flake8: 5.0.2 → 6.1.0](PyCQA/flake8@5.0.2...6.1.0)
- [github.com/pre-commit/mirrors-mypy: v0.971 → v1.6.1](pre-commit/mirrors-mypy@v0.971...v1.6.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Angus Hollands <goosey15@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and agoose77 authored Oct 29, 2023
1 parent 91d5a7e commit 31d28ea
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exclude: >
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: check-json
- id: check-yaml
Expand All @@ -24,17 +24,17 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.10.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 5.0.2
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear~=22.7]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v1.6.1
hooks:
- id: mypy
4 changes: 0 additions & 4 deletions sphinx_external_toc/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ def insert_toctrees(app: Sphinx, doctree: nodes.document) -> None:
node_list: List[nodes.Element] = []

for toctree in doc_item.subtrees:

subnode = toctree_node()
subnode["parent"] = app.env.docname
subnode.source = doctree["source"]
Expand All @@ -245,13 +244,10 @@ def insert_toctrees(app: Sphinx, doctree: nodes.document) -> None:
wrappernode.append(subnode)

for entry in toctree.items:

if isinstance(entry, UrlItem):

subnode["entries"].append((entry.title, entry.url))

elif isinstance(entry, FileItem):

child_doc_item = site_map[entry]
docname = str(entry)
title = child_doc_item.title
Expand Down
2 changes: 0 additions & 2 deletions sphinx_external_toc/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ def _parse_doc_item(

toctrees = []
for toc_idx, toc_data in enumerate(subtrees_data):

toc_path = path if shorthand_used else f"{path}{toc_idx}/"

if not (isinstance(toc_data, Mapping) and items_key in toc_data):
Expand All @@ -209,7 +208,6 @@ def _parse_doc_item(
# generate items list
items: List[Union[GlobItem, FileItem, UrlItem]] = []
for item_idx, item_data in enumerate(items_data):

if not isinstance(item_data, Mapping):
raise MalformedError(
f"entry not a mapping type @ '{toc_path}{items_key}/{item_idx}'"
Expand Down
1 change: 0 additions & 1 deletion sphinx_external_toc/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def create_site_from_toc(

# create files
for docname in chain(site_map, additional_files):

# create document
filename = docname
if not any(docname.endswith(ext) for ext in {".rst", ".md"}):
Expand Down
1 change: 0 additions & 1 deletion tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def test_file_to_sitemap(path: Path, tmp_path: Path, data_regression):


def test_create_site_map_from_path(tmp_path: Path, data_regression):

# create project files
files = [
"index.rst",
Expand Down

0 comments on commit 31d28ea

Please sign in to comment.