Skip to content

Commit 31d28ea

Browse files
[pre-commit.ci] pre-commit autoupdate (#82)
* [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>
1 parent 91d5a7e commit 31d28ea

File tree

5 files changed

+4
-12
lines changed

5 files changed

+4
-12
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exclude: >
1111
repos:
1212

1313
- repo: https://github.com/pre-commit/pre-commit-hooks
14-
rev: v4.3.0
14+
rev: v4.5.0
1515
hooks:
1616
- id: check-json
1717
- id: check-yaml
@@ -24,17 +24,17 @@ repos:
2424
- id: isort
2525

2626
- repo: https://github.com/psf/black
27-
rev: 22.6.0
27+
rev: 23.10.0
2828
hooks:
2929
- id: black
3030

3131
- repo: https://github.com/PyCQA/flake8
32-
rev: 5.0.2
32+
rev: 6.1.0
3333
hooks:
3434
- id: flake8
3535
additional_dependencies: [flake8-bugbear~=22.7]
3636

3737
- repo: https://github.com/pre-commit/mirrors-mypy
38-
rev: v0.971
38+
rev: v1.6.1
3939
hooks:
4040
- id: mypy

sphinx_external_toc/events.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ def insert_toctrees(app: Sphinx, doctree: nodes.document) -> None:
220220
node_list: List[nodes.Element] = []
221221

222222
for toctree in doc_item.subtrees:
223-
224223
subnode = toctree_node()
225224
subnode["parent"] = app.env.docname
226225
subnode.source = doctree["source"]
@@ -245,13 +244,10 @@ def insert_toctrees(app: Sphinx, doctree: nodes.document) -> None:
245244
wrappernode.append(subnode)
246245

247246
for entry in toctree.items:
248-
249247
if isinstance(entry, UrlItem):
250-
251248
subnode["entries"].append((entry.title, entry.url))
252249

253250
elif isinstance(entry, FileItem):
254-
255251
child_doc_item = site_map[entry]
256252
docname = str(entry)
257253
title = child_doc_item.title

sphinx_external_toc/parsing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ def _parse_doc_item(
193193

194194
toctrees = []
195195
for toc_idx, toc_data in enumerate(subtrees_data):
196-
197196
toc_path = path if shorthand_used else f"{path}{toc_idx}/"
198197

199198
if not (isinstance(toc_data, Mapping) and items_key in toc_data):
@@ -209,7 +208,6 @@ def _parse_doc_item(
209208
# generate items list
210209
items: List[Union[GlobItem, FileItem, UrlItem]] = []
211210
for item_idx, item_data in enumerate(items_data):
212-
213211
if not isinstance(item_data, Mapping):
214212
raise MalformedError(
215213
f"entry not a mapping type @ '{toc_path}{items_key}/{item_idx}'"

sphinx_external_toc/tools.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def create_site_from_toc(
5959

6060
# create files
6161
for docname in chain(site_map, additional_files):
62-
6362
# create document
6463
filename = docname
6564
if not any(docname.endswith(ext) for ext in {".rst", ".md"}):

tests/test_tools.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def test_file_to_sitemap(path: Path, tmp_path: Path, data_regression):
2626

2727

2828
def test_create_site_map_from_path(tmp_path: Path, data_regression):
29-
3029
# create project files
3130
files = [
3231
"index.rst",

0 commit comments

Comments
 (0)