Skip to content

Commit 2d20d47

Browse files
committed
doc: GitEvo
1 parent edd65a9 commit 2d20d47

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Version 0.1.4
22
Unreleased
33
- Improve `cli` messages.
4+
- Improve API documentation.
45

56
## Version 0.1.3
67
Released 2025-08-07

gitevo/application.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,29 @@
1414
from gitevo.report_csv import TableReport
1515
from gitevo.utils import is_git_dir, stdout_msg, stdout_link, as_str, aggregate_stat, ensure_file_extension
1616
from gitevo.exceptions import *
17-
17+
18+
1819
class GitEvo:
1920

21+
"""
22+
GitEvo app class, the main entrypoint to use GitEvo.
23+
24+
Args:
25+
repo (str): Git repository URL or local path
26+
extension (str | None): File extension to analyze, eg, .py, .ts, .js, or .java
27+
from_year (int | None): Start year for analysis (default: current year - 5)
28+
to_year (int | None): End year for analysis (default: current year)
29+
date_unit (str): Date unit for analysis, either 'year' or 'month' (default: 'year')
30+
export_html (bool): Whether to export HTML report (default: True)
31+
export_csv (bool): Whether to export CSV report (default: True)
32+
report_filename (str | None): Custom report filename (default: None)
33+
report_title (str | None): Custom report title (default: None)
34+
Raises:
35+
BadGitRepo: If the repository is invalid
36+
BadDateUnit: If the date_unit is invalid
37+
BadYearRange: If from_year is greater than to_year
38+
"""
39+
2040
def __init__(self,
2141
*,
2242
repo: str,
@@ -92,8 +112,16 @@ def decorator(func):
92112
# miner.extension = extension
93113
# miner.tree_sitter_language = tree_sitter_language
94114
# self._repo.add_miner(miner)
95-
115+
96116
def run(self) -> GitEvoResult | list[GitEvoResult]:
117+
118+
"""
119+
Run GitEvo analysis on the provided repository or repositories.
120+
121+
Returns:
122+
GitEvoResult | list[GitEvoResult]: The analysis result(s) for the repository or repositories.
123+
"""
124+
97125
print(f'Running GitEvo...')
98126
results = []
99127
for git_repo in self.git_repos:

tests/test_repos.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
import pytest
3+
24
from git import Repo
35
from gitevo import GitEvo
46
from tests.conftest import remove_folder_if_exists

0 commit comments

Comments
 (0)