Skip to content

Commit 4454fe7

Browse files
Copilotzkoppert
andcommitted
Remove default values from acknowledge_coauthors parameters
Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
1 parent 9798816 commit 4454fe7

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

contributors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def get_all_contributors(
112112
end_date: str,
113113
github_connection: object,
114114
ghe: str,
115-
acknowledge_coauthors: bool = False,
115+
acknowledge_coauthors: bool,
116116
):
117117
"""
118118
Get all contributors from the organization or repository
@@ -189,7 +189,7 @@ def get_contributors(
189189
start_date: str,
190190
end_date: str,
191191
ghe: str,
192-
acknowledge_coauthors: bool = False,
192+
acknowledge_coauthors: bool,
193193
):
194194
"""
195195
Get contributors from a single repository and filter by start end dates if present.

test_contributors.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_get_contributors(self, mock_contributor_stats):
3030
mock_repo.contributors.return_value = [mock_user]
3131
mock_repo.full_name = "owner/repo"
3232

33-
get_contributors(mock_repo, "2022-01-01", "2022-12-31", "")
33+
get_contributors(mock_repo, "2022-01-01", "2022-12-31", "", False)
3434

3535
mock_contributor_stats.assert_called_once_with(
3636
"user",
@@ -64,7 +64,7 @@ def test_get_all_contributors_with_organization(self, mock_get_contributors):
6464
ghe = ""
6565

6666
result = get_all_contributors(
67-
"org", "", "2022-01-01", "2022-12-31", mock_github_connection, ghe
67+
"org", "", "2022-01-01", "2022-12-31", mock_github_connection, ghe, False
6868
)
6969

7070
self.assertEqual(
@@ -107,7 +107,13 @@ def test_get_all_contributors_with_repository(self, mock_get_contributors):
107107
ghe = ""
108108

109109
result = get_all_contributors(
110-
"", ["owner/repo"], "2022-01-01", "2022-12-31", mock_github_connection, ghe
110+
"",
111+
["owner/repo"],
112+
"2022-01-01",
113+
"2022-12-31",
114+
mock_github_connection,
115+
ghe,
116+
False,
111117
)
112118

113119
self.assertEqual(
@@ -147,7 +153,7 @@ def test_get_contributors_skip_users_with_no_commits(self, mock_contributor_stat
147153
mock_repo.get_commits.side_effect = StopIteration
148154
ghe = ""
149155

150-
get_contributors(mock_repo, "2022-01-01", "2022-12-31", ghe)
156+
get_contributors(mock_repo, "2022-01-01", "2022-12-31", ghe, False)
151157

152158
# Note that only user is returned and user2 is not returned here because there were no commits in the date range
153159
mock_contributor_stats.assert_called_once_with(
@@ -175,7 +181,7 @@ def test_get_contributors_skip_bot(self, mock_contributor_stats):
175181
mock_repo.get_commits.side_effect = StopIteration
176182
ghe = ""
177183

178-
get_contributors(mock_repo, "2022-01-01", "2022-12-31", ghe)
184+
get_contributors(mock_repo, "2022-01-01", "2022-12-31", ghe, False)
179185

180186
# Note that only user is returned and user2 is not returned here because there were no commits in the date range
181187
mock_contributor_stats.isEmpty()
@@ -196,7 +202,7 @@ def test_get_contributors_no_commit_end_date(self, mock_contributor_stats):
196202
mock_repo.get_commits.side_effect = StopIteration
197203
ghe = ""
198204

199-
get_contributors(mock_repo, "2022-01-01", "", ghe)
205+
get_contributors(mock_repo, "2022-01-01", "", ghe, False)
200206

201207
# Note that only user is returned and user2 is not returned here because there were no commits in the date range
202208
mock_contributor_stats.assert_called_once_with(

0 commit comments

Comments
 (0)