Skip to content

Commit

Permalink
chore: typing
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Oct 24, 2024
1 parent b827039 commit 4a93990
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mknodes/info/gitrepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ def version_changes(self) -> dict[str, dict[str, list[git.Commit]]]: # type: ig
groups = iterfilters.groupby(
commits, self.get_version_for_commit, natural_sort=True
)
return {
k: iterfilters.groupby(v, lambda x: x.message.split(":")[0])
for k, v in groups.items()
}

def get_commit_group(commit: git.Commit) -> str:
assert isinstance(commit.message, str)
return commit.message.split(":")[0]

return {k: iterfilters.groupby(v, get_commit_group) for k, v in groups.items()}

@functools.cached_property
def all_commits(self) -> list[git.Commit]: # type: ignore[name-defined]
Expand Down

0 comments on commit 4a93990

Please sign in to comment.