Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HCookie committed Oct 16, 2024
1 parent 4aa83ed commit 8baaec2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions contributors/contributor_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from typing import List

import requests
from dataclasses import dataclass
from dataclasses import dataclass, field


@dataclass
Expand All @@ -38,7 +38,7 @@ class ContributorStats:
contribution_count: int
commit_url: str
sponsor_info: str
organisations: list[str] | None = []
organisations: list[str] = field(default_factory=list)

new_contributor: bool = False

Expand Down
17 changes: 10 additions & 7 deletions contributors/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,15 @@ def write_markdown_file(
markdown_file.write(f"- Repository: {repository}\n")
markdown_file.write("\n")
markdown_file.write(summary_table)
for key, t in table.items():
markdown_file.write(f"## {key}\n")
markdown_file.write(t)
# markdown_file.write(
# "\n _this file was generated by the [Contributors GitHub Action](https://github.com/github/contributors)_\n"
# )
if len(table) == 1 and 'Independent' in table:
markdown_file.write(table['Independent'])
else:
for key, t in table.items():
markdown_file.write(f"## {key}\n")
markdown_file.write(t)
markdown_file.write(
"\n _this file was generated by the [Contributors GitHub Action](https://github.com/HCookie/contributors)_\n"
)


def get_summary_table(collaborators, start_date, end_date, total_contributions):
Expand Down Expand Up @@ -223,7 +226,7 @@ def get_contributor_table(

added_to_org: bool = False
print(show_organisations_list, collaborator.organisations)
for org in collaborator.organisations:
for org in collaborator.organisations or []:
if org in show_organisations_list:
organisation_contributors[org].append(row)
added_to_org = True
Expand Down

0 comments on commit 8baaec2

Please sign in to comment.