Skip to content

Commit

Permalink
chore(checks): fix type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed May 6, 2024
1 parent 0e386e6 commit f45158e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion weblate/checks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

from django_stubs_ext import StrOrPromise

from weblate.trans.models import Unit


class Check:
"""Basic class for checks."""
Expand Down Expand Up @@ -202,7 +204,7 @@ def handle_batch(self, unit, component):
component.batched_checks.add(self.check_id)
return self.check_id in unit.all_checks_names

def check_component(self, component) -> bool:
def check_component(self, component) -> Iterable[Unit]:
raise NotImplementedError

def perform_batch(self, component) -> None:
Expand Down
2 changes: 1 addition & 1 deletion weblate/checks/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class BaseFormatCheck(TargetCheck):
regexp: Pattern[str]
plural_parameter_regexp: Pattern[str] | None = None
default_disabled = True
normalize_remove = None
normalize_remove: str | None = None

def check_target_unit(self, sources, targets, unit):
"""Check single unit, handling plurals."""
Expand Down

0 comments on commit f45158e

Please sign in to comment.