Skip to content

Commit 342241d

Browse files
committed
Add type checking with ty
1 parent b1a16b6 commit 342241d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ all: check
2323

2424
check: lint test
2525

26-
lint: ruff
26+
lint: ruff ty
2727

2828
ruff:
2929
uvx ruff check
3030

31+
ty:
32+
uvx ty check
33+
3134
test:
3235
uv run pytest -vv --cov=msgcheck --cov-report=term-missing

src/msgcheck/po.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def __init__( # noqa: PLR0913
134134
self.filename = filename
135135
self.line = line
136136
# unescape strings
137-
msg = {k: escape_decode(v)[0].decode(charset) for k, v in msg.items()}
137+
msg = {k: escape_decode(v)[0].decode(charset) for k, v in msg.items()} # ty: ignore[unresolved-attribute]
138138
# build messages as a list of tuples: (string, translation)
139139
self.messages = []
140140
if "msgid_plural" in msg:
@@ -544,7 +544,7 @@ def _get_language_checker(self, po_file: PoFile, reports: list[PoReport]) -> lis
544544
tmp_file.flush()
545545
_dict = DictWithPWL(lang, tmp_file.name)
546546
else:
547-
_dict = DictWithPWL(lang, None)
547+
_dict = DictWithPWL(lang, None) # ty: ignore[invalid-argument-type]
548548
checker.append(SpellChecker(_dict))
549549
except DictNotFoundError:
550550
reports.append(

0 commit comments

Comments
 (0)