diff --git a/ForgejoRepoAPI.py b/ForgejoRepoAPI.py index 3a386d60..b1e8835b 100644 --- a/ForgejoRepoAPI.py +++ b/ForgejoRepoAPI.py @@ -90,6 +90,8 @@ def get_commits(self, repo: Repository, files: bool = True) -> list[Commit]: files=( [f.filename for f in getattr(c, "files", [])] if files else None ), + additions=None, # TODO + deletions=None, # TODO ) for c in commits ] diff --git a/GitHubRepoAPI.py b/GitHubRepoAPI.py index 576021bb..deffa10a 100644 --- a/GitHubRepoAPI.py +++ b/GitHubRepoAPI.py @@ -73,6 +73,8 @@ def get_commits(self, repo: Repository, files: bool = True) -> list[Commit]: author=self.get_user_data(c.author), date=c.commit.author.date, files=[f.filename for f in c.files] if files else None, + additions=c.stats.additions, + deletions=c.stats.deletions, ) for c in commits ] diff --git a/commits_parser.py b/commits_parser.py index 333a5af5..7bad792d 100644 --- a/commits_parser.py +++ b/commits_parser.py @@ -19,6 +19,8 @@ class CommitData: changed_files: str = '' commit_id: str = '' branch: str = '' + additions: str = '' + deletions: str = '' def log_repository_commits( @@ -54,6 +56,8 @@ def log_repository_commits( changed_files=changed_files, commit_id=commit._id, branch=branch, + additions=commit.additions, + deletions=commit.deletions, ) info = asdict(commit_data) diff --git a/interface_wrapper.py b/interface_wrapper.py index aa28736d..f0c91344 100644 --- a/interface_wrapper.py +++ b/interface_wrapper.py @@ -39,6 +39,8 @@ class Commit: author: User date: datetime files: list[str] + additions: int + deletions: int @dataclass