|
14 | 14 | from gitevo.report_csv import TableReport |
15 | 15 | from gitevo.utils import is_git_dir, stdout_msg, stdout_link, as_str, aggregate_stat, ensure_file_extension |
16 | 16 | from gitevo.exceptions import * |
17 | | - |
| 17 | + |
| 18 | + |
18 | 19 | class GitEvo: |
19 | 20 |
|
| 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 | + |
20 | 40 | def __init__(self, |
21 | 41 | *, |
22 | 42 | repo: str, |
@@ -92,8 +112,16 @@ def decorator(func): |
92 | 112 | # miner.extension = extension |
93 | 113 | # miner.tree_sitter_language = tree_sitter_language |
94 | 114 | # self._repo.add_miner(miner) |
95 | | - |
| 115 | + |
96 | 116 | 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 | + |
97 | 125 | print(f'Running GitEvo...') |
98 | 126 | results = [] |
99 | 127 | for git_repo in self.git_repos: |
|
0 commit comments