Skip to content

Commit 5550e43

Browse files
committed
Fix typing issues
1 parent 147e791 commit 5550e43

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/msgcheck/po.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def __init__( # noqa: PLR0913
127127
msg: dict[str, str],
128128
charset: str,
129129
fuzzy: bool,
130-
fmt: str,
130+
fmt: str | None,
131131
noqa: bool,
132132
) -> None:
133133
"""Build a PO message."""
@@ -422,9 +422,9 @@ def __init__(self, filename: str) -> None:
422422
"language_numline": 0,
423423
"charset": "utf-8",
424424
}
425-
self.msgs = []
425+
self.msgs: list[PoMessage] = []
426426

427-
def _add_message(self, numline_msgid: int, fuzzy: bool, fmt: str, noqa: bool, msg: dict[str, str]) -> None:
427+
def _add_message(self, numline_msgid: int, fuzzy: bool, fmt: str | None, noqa: bool, msg: dict[str, str]) -> None:
428428
"""Add a message from PO file in list of messages."""
429429
if "msgid" in msg and not msg["msgid"]:
430430
# find file language/charset in properties
@@ -504,7 +504,7 @@ def __init__(self) -> None:
504504
# spelling options
505505
self.spelling: str | None = None
506506
self.dicts: str | None = None
507-
self.extra_checkers = []
507+
self.extra_checkers: list[SpellChecker] = []
508508
self.pwl: str | None = None
509509

510510
def __repr__(self) -> str:
@@ -568,7 +568,13 @@ def _get_language_checker(self, po_file: PoFile, reports: list[PoReport]) -> lis
568568
checker = []
569569
return checker
570570

571-
def check_msg(self, po_file: PoFile, checker: SpellChecker, msg: PoMessage, reports: list[PoReport]) -> None:
571+
def check_msg(
572+
self,
573+
po_file: PoFile,
574+
checker: list[SpellChecker],
575+
msg: PoMessage,
576+
reports: list[PoReport],
577+
) -> None:
572578
"""Check one message."""
573579
if self.checks["extract"]:
574580
for mid, mstr in msg.messages:
@@ -637,7 +643,6 @@ def check_files(self, files: list[str]) -> list[tuple[str, list[PoReport]]]:
637643
result.append((po_file.filename, self.check_pofile(po_file)))
638644
else:
639645
# compilation failed
640-
compile_output = bytes(compile_output).decode("utf-8")
641646
result.append(
642647
(
643648
po_file.filename,

0 commit comments

Comments
 (0)