chore: enable strict mode on mypy, add isort check
This commit is contained in:
parent
ad3c378d58
commit
cb1d3dd68e
|
@ -1,5 +1,6 @@
|
|||
/*.egg-info/
|
||||
**/__pycache__/
|
||||
/.mypy_cache/
|
||||
|
||||
/.pdm.toml
|
||||
/.venv/
|
||||
|
|
|
@ -28,8 +28,9 @@ py-modules = ["waifu"]
|
|||
|
||||
[tool.pdm.scripts]
|
||||
lint = {shell = "pylint --jobs 0 ./waifu/**/*.py"}
|
||||
importcheck = "isort --check --diff waifu"
|
||||
stylecheck = "yapf --parallel --diff --recursive waifu"
|
||||
typecheck = "mypy waifu"
|
||||
typecheck = "mypy --strict waifu"
|
||||
|
||||
[tool.yapf]
|
||||
based_on_style = "google"
|
||||
|
|
|
@ -6,7 +6,7 @@ T = t.TypeVar("T")
|
|||
class BaseDataset(t.Generic[T]):
|
||||
'''Base dataset class.'''
|
||||
|
||||
def __iter__(self):
|
||||
def __iter__(self) -> t.Generator[T, None, None]:
|
||||
'''Implements the basic iterator interface.'''
|
||||
return self.generator()
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import typing as t
|
|||
class BaseModule:
|
||||
'''Base module class.'''
|
||||
|
||||
def __iter__(self):
|
||||
def __iter__(self) -> t.Generator[str, None, None]:
|
||||
'''Implements the basic iterator interface.'''
|
||||
return self.generator()
|
||||
|
||||
|
|
Loading…
Reference in New Issue