From 9b0cabf539ea506539e7726da6c3003192d061ee Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 31 Dec 2022 09:53:34 -0600 Subject: [PATCH] !squash more types --- src/vcspull/config.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vcspull/config.py b/src/vcspull/config.py index c60b90e2..c65291fd 100644 --- a/src/vcspull/config.py +++ b/src/vcspull/config.py @@ -41,23 +41,25 @@ class Config: repo_dict_map: list["Repo"] repos: list["Repo"] = dataclasses.field(init=False, default_factory=list) - def __post_init__(self): + def __post_init__(self) -> None: for repo in self.repo_dict_map: if isinstance(repo, dict): - self.repos.append(create_project(**repo)) # type:ignore + self.repos.append(create_project(**repo)) - def filter_repos(self, **kwargs) -> list["Repo"]: + def filter_repos(self, **kwargs: object) -> list["Repo"]: return QueryList(self.repos).filter(**kwargs) @classmethod - def from_yaml_file(cls, file_path: pathlib.Path, cwd=pathlib.Path.cwd()): + def from_yaml_file( + cls, file_path: pathlib.Path, cwd: pathlib.Path = pathlib.Path.cwd() + ) -> "Config": # load yaml raw_config = yaml.load(open(file_path).read(), Loader=yaml.Loader) repos: list[ConfigDict] = [] for directory, repo_map in raw_config.items(): assert isinstance(repo_map, dict) for repo, repo_data in repo_map.items(): - conf: dict = {} + conf: dict[str, t.Any] = {} if isinstance(repo_data, str): conf["url"] = repo_data