Skip to content

Commit 894d66e

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f748069 commit 894d66e

File tree

4 files changed

+29
-18
lines changed

4 files changed

+29
-18
lines changed

src/latex_dependency_scanner/scanner.py

+16-13
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
"""List[str]: List of typical image extensions contained in LaTeX files."""
2121

2222
COMMON_EXTENSIONS_IN_TEX = (
23-
[
24-
# No extension if the extension is provided.
25-
"",
26-
# TeX formats.
27-
".bib",
28-
".sty",
29-
]
30-
+ COMMON_GRAPHICS_EXTENSIONS
31-
+ COMMON_TEX_EXTENSIONS
23+
[
24+
# No extension if the extension is provided.
25+
"",
26+
# TeX formats.
27+
".bib",
28+
".sty",
29+
]
30+
+ COMMON_GRAPHICS_EXTENSIONS
31+
+ COMMON_TEX_EXTENSIONS
3232
)
3333
"""List[str]: List of typical file extensions included in latex files"""
3434

@@ -66,9 +66,9 @@ def scan(paths: Union[Path, List[Path]]):
6666

6767

6868
def yield_nodes_from_node(
69-
node: Path,
70-
nodes: List[Path],
71-
relative_to: Optional[Path] = None,
69+
node: Path,
70+
nodes: List[Path],
71+
relative_to: Optional[Path] = None,
7272
):
7373
r"""Yield nodes from node.
7474
@@ -134,7 +134,10 @@ def yield_nodes_from_node(
134134
common_extensions = [ext]
135135
else:
136136
common_extensions = COMMON_GRAPHICS_EXTENSIONS
137-
elif match.group("type") in ["glsxtrresourcefile", "GlsXtrLoadResources"]:
137+
elif match.group("type") in [
138+
"glsxtrresourcefile",
139+
"GlsXtrLoadResources",
140+
]:
138141
common_extensions = [".glstex", ".bib"] # .bib for bib2gls
139142
elif match.group("type") == "lstinputlistings":
140143
common_extensions = [""]

tests/resources/acronyms.glstex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
\newabbreviation{abc}{ABC}{AlphaBetaGamma}
1+
\newabbreviation{abc}{ABC}{AlphaBetaGamma}

tests/resources/symbols.bib

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ @symbol{Ab
22
name = {\ensuremath{A_b}},
33
description = {Symbol Ab},
44
}
5-

tests/test_scan.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,11 @@ def test_glossaries(tmp_path):
411411

412412
nodes = scan(tmp_path / "document.tex")
413413

414-
assert nodes == [tmp_path / "document.tex", tmp_path / "symbols.bib", tmp_path / "acronyms.glstex"]
414+
assert nodes == [
415+
tmp_path / "document.tex",
416+
tmp_path / "symbols.bib",
417+
tmp_path / "acronyms.glstex",
418+
]
415419

416420

417421
@pytest.mark.end_to_end
@@ -453,5 +457,10 @@ def test_glossaries_without_files(tmp_path):
453457

454458
nodes = scan(tmp_path / "document.tex")
455459

456-
assert nodes == [tmp_path / "document.tex", tmp_path / "symbols.glstex", tmp_path / "symbols.bib",
457-
tmp_path / "acronyms.glstex", tmp_path / "acronyms.bib"]
460+
assert nodes == [
461+
tmp_path / "document.tex",
462+
tmp_path / "symbols.glstex",
463+
tmp_path / "symbols.bib",
464+
tmp_path / "acronyms.glstex",
465+
tmp_path / "acronyms.bib",
466+
]

0 commit comments

Comments
 (0)