You've already forked wakapi-readme-stats
graph redrawn
This commit is contained in:
@@ -11,7 +11,7 @@ from manager_debug import DebugManager as DBM
|
||||
async def calculate_yearly_commit_data(repositories: Dict) -> Dict:
|
||||
"""
|
||||
Calculate commit data by years.
|
||||
Commit data includes difference between contribution additions and deletions in each quarter of each recorded year.
|
||||
Commit data includes contribution additions and deletions in each quarter of each recorded year.
|
||||
|
||||
:param repositories: user repositories info dictionary.
|
||||
:returns: Commit quarter yearly data dictionary.
|
||||
@@ -21,7 +21,7 @@ async def calculate_yearly_commit_data(repositories: Dict) -> Dict:
|
||||
total = len(repositories["data"]["user"]["repositories"]["nodes"])
|
||||
for ind, repo in enumerate(repositories["data"]["user"]["repositories"]["nodes"]):
|
||||
if repo["name"] not in EM.IGNORED_REPOS:
|
||||
repo_name = "private" if repo["isPrivate"] else f"{repo['owner']['login']}/{repo['name']}"
|
||||
repo_name = "[private]" if repo["isPrivate"] else f"{repo['owner']['login']}/{repo['name']}"
|
||||
DBM.i(f"\t{ind + 1}/{total} Retrieving repo: {repo_name}")
|
||||
await update_yearly_data_with_commit_stats(repo, yearly_data)
|
||||
DBM.g("Yearly commit data calculated!")
|
||||
@@ -55,5 +55,6 @@ async def update_yearly_data_with_commit_stats(repo_details: Dict, yearly_data:
|
||||
if quarter not in yearly_data[curr_year]:
|
||||
yearly_data[curr_year][quarter] = dict()
|
||||
if repo_details["primaryLanguage"]["name"] not in yearly_data[curr_year][quarter]:
|
||||
yearly_data[curr_year][quarter][repo_details["primaryLanguage"]["name"]] = 0
|
||||
yearly_data[curr_year][quarter][repo_details["primaryLanguage"]["name"]] += commit["additions"] - commit["deletions"]
|
||||
yearly_data[curr_year][quarter][repo_details["primaryLanguage"]["name"]] = {"add": 0, "del": 0}
|
||||
yearly_data[curr_year][quarter][repo_details["primaryLanguage"]["name"]]["add"] += commit["additions"]
|
||||
yearly_data[curr_year][quarter][repo_details["primaryLanguage"]["name"]]["del"] += commit["deletions"]
|
||||
|
||||
Reference in New Issue
Block a user