@@ -124,7 +124,7 @@ def __init__( # noqa: PLR0913
124124 self ,
125125 filename : str ,
126126 line : int ,
127- msg : dict [Any , Any ],
127+ msg : dict [str , str ],
128128 charset : str ,
129129 fuzzy : bool ,
130130 fmt : str ,
@@ -305,7 +305,7 @@ def check_spelling(self, spelling: str, checkers: list[SpellChecker]) -> list[Po
305305
306306 Return a list with errors detected.
307307 """
308- errors = []
308+ errors : list [ PoReport ] = []
309309 if not checkers :
310310 return errors
311311 for mid , mstr in self .messages :
@@ -349,13 +349,13 @@ def __init__(self) -> None:
349349 self .msgfuzzy = False
350350 self .noqa = False
351351 self .msgnoqa = False
352- self .fmt = None
353- self .msgfmt = None
354- self .msg = {}
352+ self .fmt : str | None = None
353+ self .msgfmt : str | None = None
354+ self .msg : dict [ str , str ] = {}
355355 self .msgcurrent = ""
356356 self .oldmsgcurrent = ""
357357
358- def check_line (self , line : str ) -> tuple [int , bool , str , bool , str ] | None :
358+ def check_line (self , line : str ) -> tuple [int , bool , str | None , bool , dict [ str , str ] ] | None :
359359 """Check a line of a PO file."""
360360 message = None
361361 self .numline += 1
@@ -395,7 +395,7 @@ def check_line(self, line: str) -> tuple[int, bool, str, bool, str] | None:
395395 self .msg [self .msgcurrent ] = self .msg .get (self .msgcurrent , "" ) + line [1 :- 1 ]
396396 return message
397397
398- def last_check (self ) -> tuple [int , bool , str , bool , str ] | None :
398+ def last_check (self ) -> tuple [int , bool , str | None , bool , dict [ str , str ] ] | None :
399399 """Consume the last message (after all lines were read)."""
400400 if self .msgcurrent .startswith ("msgstr" ):
401401 return (
@@ -425,7 +425,7 @@ def __init__(self, filename: str) -> None:
425425 self .msgs = []
426426
427427 # pylint: disable=too-many-arguments, too-many-positional-arguments
428- def _add_message (self , numline_msgid : int , fuzzy : bool , fmt : str , noqa : bool , msg : str ) -> None :
428+ def _add_message (self , numline_msgid : int , fuzzy : bool , fmt : str , noqa : bool , msg : dict [ str , str ] ) -> None :
429429 """Add a message from PO file in list of messages."""
430430 if "msgid" in msg and not msg ["msgid" ]:
431431 # find file language/charset in properties
0 commit comments