Skip to content

Commit

Permalink
!squash more types
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Dec 31, 2022
1 parent 0659189 commit 9b0cabf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/vcspull/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9b0cabf

Please sign in to comment.