Skip to content

Commit 579ee72

Browse files
committed
Added extra stats for commits
1 parent cf0c0f0 commit 579ee72

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

.github/workflows/large-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
run: pip install -r requirements.txt
2323

2424
- name: Run test
25-
run: python3 test_token_usage.py --tt1 ${{ secrets.TEST_TOKEN_GITHUB }} --tt2 ${{ secrets.SECOND_TEST_TOKEN_GITHUB }} --repo moevm/github_repo_commitment_calc --out out.csv
25+
run: python3 test_token_usage.py --tt1 ${{ secrets.TEST_TOKEN_GITHUB }} --tt2 ${{ secrets.SECOND_TEST_TOKEN_GITHUB }} --repo thehighestmath/SummerPractice --out out.csv

ForgejoRepoAPI.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def get_commits(self, repo: Repository, files: bool = True) -> list[Commit]:
9090
files=(
9191
[f.filename for f in getattr(c, "files", [])] if files else None
9292
),
93+
additions=None, # TODO
94+
deletions=None,
9395
)
9496
for c in commits
9597
]

GitHubRepoAPI.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ def get_commits(self, repo: Repository, files: bool = True) -> list[Commit]:
7373
author=self.get_user_data(c.author),
7474
date=c.commit.author.date,
7575
files=[f.filename for f in c.files] if files else None,
76+
additions=c.stats.additions,
77+
deletions=c.stats.deletions,
7678
)
7779
for c in commits
7880
]

commits_parser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class CommitData:
1919
changed_files: str = ''
2020
commit_id: str = ''
2121
branch: str = ''
22+
additions: str = ''
23+
deletions: str = ''
2224

2325

2426
def log_repository_commits(
@@ -54,6 +56,8 @@ def log_repository_commits(
5456
changed_files=changed_files,
5557
commit_id=commit._id,
5658
branch=branch,
59+
additions=commit.additions,
60+
deletions=commit.deletions,
5761
)
5862
info = asdict(commit_data)
5963

interface_wrapper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class Commit:
3939
author: User
4040
date: datetime
4141
files: list[str]
42+
additions: int
43+
deletions: int
4244

4345

4446
@dataclass

0 commit comments

Comments
 (0)