MCPcopy
hub / github.com/django/django / get_pr_total_changes

Function get_pr_total_changes

scripts/pr_quality/check_pr.py:128–146  ·  view source on GitHub ↗

Return total lines changed in the PR (additions + deletions).

(pr_number, repo, token)

Source from the content-addressed store, hash-verified

126
127
128def get_pr_total_changes(pr_number, repo, token):
129 """Return total lines changed in the PR (additions + deletions)."""
130 total_changes = 0
131 page = 1
132 while True:
133 results = github_request(
134 "GET",
135 f"/pulls/{pr_number}/files",
136 token,
137 repo,
138 params={"per_page": GITHUB_PER_PAGE, "page": page},
139 )
140 if not results:
141 break
142 total_changes += sum(f["changes"] for f in results)
143 if len(results) < GITHUB_PER_PAGE:
144 break
145 page += 1
146 return total_changes
147
148
149def get_comment_ids_to_delete(pr_number, repo, token):

Callers 1

mainFunction · 0.85

Calls 1

github_requestFunction · 0.85

Tested by

no test coverage detected