Skip to content

Commit 41a51a8

Browse files
committedApr 1, 2025
Fixing some minor SonarQube findings
1 parent f856be1 commit 41a51a8

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed
 

‎Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,19 @@ ENV DEBIAN_FRONTEND=noninteractive
1111

1212
# install packages and cleanup afterwards
1313
RUN apt-get update && apt-get dist-upgrade -y && \
14-
apt-get install -y python3 python3-lxml git texlive-xetex texlive-lang-greek texlive-lang-german latexmk texlive-extra-utils pandoc calibre imagemagick ghostscript && \
14+
apt-get install -y \
15+
calibre \
16+
ghostscript \
17+
git \
18+
imagemagick \
19+
latexmk \
20+
pandoc \
21+
python3 \
22+
python3-lxml \
23+
texlive-extra-utils \
24+
texlive-lang-german \
25+
texlive-lang-greek \
26+
texlive-xetex && \
1527
apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/
1628

1729
# set working directory

‎scripts/ebook/step_3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
# remove all images
101101
cont = re.sub(
102-
r"\\includegraphics\[.*?\]\{.*?\}",
102+
r"\\includegraphics\[[^\]]*\]\{[^\}]*\}",
103103
"",
104104
cont,
105105
flags=re.DOTALL,

‎scripts/ebook/step_4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
def convert_parsel(s: str) -> str:
1919
"""Convert text to Parsel."""
20-
# TODO: for spellcheck doc version we should return here
20+
# for spellcheck of .doc version we should return here
2121
# return s
2222
# small ss -> ß -> sss ; s->ss
2323
s = s.replace("ss", "ß").replace("s", "ss").replace("ß", "sss")

‎scripts/ebook/step_6.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def check_html(cont: str) -> None:
2525
"""Check html syntax."""
2626
parser = etree.XMLParser(recover=False) # Do not auto-fix errors
2727
try:
28-
etree.fromstring(cont, parser) # noqa: S320
28+
etree.fromstring(cont, parser)
2929
except etree.XMLSyntaxError as e:
3030
print("HTML Error:", e)
3131
sys.exit(1)

‎scripts/ebook/v1/1_latex2html.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,6 @@ def find_tex_commands(s: str) -> list:
785785
):
786786
print(f"{value}\t{key}")
787787

788-
assert (
789-
len(d_tex_commands_unhandled) == 0
790-
), "Error: unhandled LaTeX commands found, see above"
788+
assert len(d_tex_commands_unhandled) == 0, (
789+
"Error: unhandled LaTeX commands found, see above"
790+
)

0 commit comments

Comments
 (0)