Skip to content

Commit e335bf8

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

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
@@ -219,9 +219,9 @@ jobs:
219219
| ------------------ | ------------------- | ------------------ |
220220
| 1 | 143 | 0% |
221221
222-
| Username | Company | All Time Contribution Count | New Contributor | Commits between 2021-01-01 and 2023-10-10 |
223-
| --------- | -------- | --------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
224-
| @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) |
222+
| Username | Company | All Time Contribution Count | New Contributor | Commits between 2021-01-01 and 2023-10-10 |
223+
| --------- | ------- | --------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
224+
| @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) |
225225
```
226226

227227
## Example Markdown output with no dates supplied
@@ -235,9 +235,9 @@ jobs:
235235
| ------------------ | ------------------- | ------------------ |
236236
| 1 | 1913 | 0% |
237237
238-
| Username | Company | All Time Contribution Count | New Contributor | Sponsor URL | Commits between 2021-09-01 and 2023-09-30 |
239-
| --------- | -------- | --------------------------- | --------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
240-
| @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) |
238+
| Username | Company | All Time Contribution Count | New Contributor | Sponsor URL | Commits between 2021-09-01 and 2023-09-30 |
239+
| --------- | ------- | --------------------------- | --------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
240+
| @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) |
241241
```
242242

243243
## GitHub Actions Job Summary

markdown.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@ def write_to_markdown(
1818
"""
1919
This function writes a list of collaborators to a markdown file in table format
2020
and optionally to GitHub Actions Job Summary if running in a GitHub Actions environment.
21-
Each collaborator is represented as a dictionary with keys 'username',
22-
'company', 'contribution_count', 'new_contributor', and 'commits'.
21+
Each collaborator is represented as a ContributorStats object with fields
22+
'username', 'company', 'contribution_count', 'new_contributor', and 'commit_url'.
2323
2424
Args:
25-
collaborators (list): A list of dictionaries, where each dictionary
26-
represents a collaborator. Each dictionary should
27-
have the keys 'username', 'company', 'contribution_count',
28-
and 'commits'.
25+
collaborators (list): A list of ContributorStats objects. Each object should
26+
have the fields 'username', 'company', 'contribution_count',
27+
'new_contributor', and 'commit_url'.
2928
filename (str): The path of the markdown file to which the table will
3029
be written.
3130
start_date (str): The start date of the date range for the contributor
@@ -156,8 +155,9 @@ def get_summary_table(collaborators, start_date, end_date, total_contributions):
156155
This function returns a string containing a markdown table of the summary statistics.
157156
158157
Args:
159-
collaborators (list): A list of dictionaries, where each dictionary represents a collaborator.
160-
Each dictionary should have the keys 'username', 'company', 'contribution_count', and 'commits'.
158+
collaborators (list): A list of ContributorStats objects.
159+
Each object should have the fields 'username', 'company',
160+
'contribution_count', and 'new_contributor'.
161161
start_date (str): The start date of the date range for the contributor list.
162162
end_date (str): The end date of the date range for the contributor list.
163163
total_contributions (int): The total number of contributions made by all of the contributors.
@@ -201,8 +201,9 @@ def get_contributor_table(
201201
This function returns a string containing a markdown table of the contributors and the total contribution count.
202202
203203
Args:
204-
collaborators (list): A list of dictionaries, where each dictionary represents a collaborator.
205-
Each dictionary should have the keys 'username', 'contribution_count', and 'commits'.
204+
collaborators (list): A list of ContributorStats objects.
205+
Each object should have the fields 'username', 'company',
206+
'contribution_count', 'commit_url', and 'new_contributor'.
206207
start_date (str): The start date of the date range for the contributor list.
207208
end_date (str): The end date of the date range for the contributor list.
208209
organization (str): The organization for which the contributors are being listed.
@@ -235,7 +236,7 @@ def get_contributor_table(
235236
total_contributions += collaborator.contribution_count
236237
username = collaborator.username
237238
contribution_count = collaborator.contribution_count
238-
company = collaborator.company.strip() if collaborator.company else "-"
239+
company = collaborator.company or "-"
239240
if repository:
240241
commit_urls = collaborator.commit_url
241242
if organization:

0 commit comments

Comments
 (0)