Skip to content

Commit

Permalink
Add type annotation and mypy config
Browse files Browse the repository at this point in the history
  • Loading branch information
lucc committed Dec 9, 2023
1 parent 24c3cf7 commit dddc98c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions khard/carddav_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,8 +996,8 @@ def _parse_yaml(input: str) -> Dict:
return contact_data

@staticmethod
def _set_string_list(setter: Callable[[Union[str, List]], None], key: str,
data: Dict) -> None:
def _set_string_list(setter: Callable[[str], None], key: str,
data: Dict[str, Union[str, List[str]]]) -> None:
"""Pre-process a string or list and set each value with the given
setter
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ write_to = "khard/version.py"

[tool.mypy]
packages = "khard"
check_untyped_defs = true
disallow_untyped_calls = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
warn_redundant_casts = true

[[tool.mypy.overrides]]
# These do not provide type anotations or stub files
Expand Down

0 comments on commit dddc98c

Please sign in to comment.