Skip to content

Commit 501d048

Browse files
committed
docs: clarify contributor object fields
Signed-off-by: Venu Vardhan Reddy Tekula <venuvrtekula@gmail.com>
1 parent c70e4ac commit 501d048

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ jobs:
236236
| ------------------ | ------------------- | ------------------ |
237237
| 1 | 143 | 0% |
238238
239-
| Username | Company | All Time Contribution Count | New Contributor | Commits between 2021-01-01 and 2023-10-10 |
240-
| --------- | -------- | --------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
241-
| @zkoppert | @github | 143 | False | [super-linter/super-linter](https://github.com/super-linter/super-linter/commits?author=zkoppert&since=2021-01-01&until=2023-10-10) |
239+
| Username | Company | All Time Contribution Count | New Contributor | Commits between 2021-01-01 and 2023-10-10 |
240+
| --------- | ------- | --------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
241+
| @zkoppert | @github | 143 | False | [super-linter/super-linter](https://github.com/super-linter/super-linter/commits?author=zkoppert&since=2021-01-01&until=2023-10-10) |
242242
```
243243
244244
## Example Markdown output with no dates supplied
@@ -252,9 +252,9 @@ jobs:
252252
| ------------------ | ------------------- | ------------------ |
253253
| 1 | 1913 | 0% |
254254
255-
| Username | Company | All Time Contribution Count | New Contributor | Sponsor URL | Commits between 2021-09-01 and 2023-09-30 |
256-
| --------- | -------- | --------------------------- | --------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
257-
| @zkoppert | @github | 1913 | False | [Sponsor Link](https://github.com/sponsors/zkoppert) | [super-linter/super-linter](https://github.com/super-linter/super-linter/commits?author=zkoppert&since=2021-09-01&until=2023-09-30) |
255+
| Username | Company | All Time Contribution Count | New Contributor | Sponsor URL | Commits between 2021-09-01 and 2023-09-30 |
256+
| --------- | ------- | --------------------------- | --------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
257+
| @zkoppert | @github | 1913 | False | [Sponsor Link](https://github.com/sponsors/zkoppert) | [super-linter/super-linter](https://github.com/super-linter/super-linter/commits?author=zkoppert&since=2021-09-01&until=2023-09-30) |
258258
```
259259
260260
## GitHub Actions Job Summary

markdown.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ def write_to_markdown(
2525
"""
2626
This function writes a list of collaborators to a markdown file in table format
2727
and optionally to GitHub Actions Job Summary if running in a GitHub Actions environment.
28-
Each collaborator is represented as a dictionary with keys 'username',
29-
'company', 'contribution_count', 'new_contributor', and 'commits'.
28+
Each collaborator is represented as a ContributorStats object with fields
29+
'username', 'company', 'contribution_count', 'new_contributor', and 'commit_url'.
3030
3131
Args:
32-
collaborators (list): A list of dictionaries, where each dictionary
33-
represents a collaborator. Each dictionary should
34-
have the keys 'username', 'company', 'contribution_count',
35-
and 'commits'.
32+
collaborators (list): A list of ContributorStats objects. Each object should
33+
have the fields 'username', 'company', 'contribution_count',
34+
'new_contributor', and 'commit_url'.
3635
filename (str): The path of the markdown file to which the table will
3736
be written.
3837
start_date (str): The start date of the date range for the contributor
@@ -166,8 +165,9 @@ def get_summary_table(collaborators, start_date, end_date, total_contributions):
166165
This function returns a string containing a markdown table of the summary statistics.
167166
168167
Args:
169-
collaborators (list): A list of dictionaries, where each dictionary represents a collaborator.
170-
Each dictionary should have the keys 'username', 'company', 'contribution_count', and 'commits'.
168+
collaborators (list): A list of ContributorStats objects.
169+
Each object should have the fields 'username', 'company',
170+
'contribution_count', and 'new_contributor'.
171171
start_date (str): The start date of the date range for the contributor list.
172172
end_date (str): The end date of the date range for the contributor list.
173173
total_contributions (int): The total number of contributions made by all of the contributors.
@@ -212,8 +212,9 @@ def get_contributor_table(
212212
This function returns a string containing a markdown table of the contributors and the total contribution count.
213213
214214
Args:
215-
collaborators (list): A list of dictionaries, where each dictionary represents a collaborator.
216-
Each dictionary should have the keys 'username', 'contribution_count', and 'commits'.
215+
collaborators (list): A list of ContributorStats objects.
216+
Each object should have the fields 'username', 'company',
217+
'contribution_count', 'commit_url', and 'new_contributor'.
217218
start_date (str): The start date of the date range for the contributor list.
218219
end_date (str): The end date of the date range for the contributor list.
219220
organization (str): The organization for which the contributors are being listed.
@@ -252,7 +253,7 @@ def get_contributor_table(
252253
total_contributions += collaborator.contribution_count
253254
username = collaborator.username
254255
contribution_count = collaborator.contribution_count
255-
company = collaborator.company.strip() if collaborator.company else "-"
256+
company = collaborator.company or "-"
256257
if repository:
257258
commit_urls = collaborator.commit_url
258259
if organization:

0 commit comments

Comments
 (0)