MCPcopy
hub / github.com/django/django / get_recent_commit_count

Function get_recent_commit_count

scripts/pr_quality/check_pr.py:110–125  ·  view source on GitHub ↗

Return the number of recent commits by the author, up to max_count.

(pr_author, repo, token, since_days, max_count)

Source from the content-addressed store, hash-verified

108
109
110def get_recent_commit_count(pr_author, repo, token, since_days, max_count):
111 """Return the number of recent commits by the author, up to max_count."""
112 if not pr_author:
113 return 0
114
115 since = (datetime.now(timezone.utc) - timedelta(days=since_days)).strftime(
116 "%Y-%m-%dT%H:%M:%SZ"
117 )
118 results = github_request(
119 "GET",
120 "/commits",
121 token,
122 repo,
123 params={"author": pr_author, "since": since, "per_page": max_count},
124 )
125 return len(results)
126
127
128def get_pr_total_changes(pr_number, repo, token):

Callers 1

mainFunction · 0.85

Calls 2

github_requestFunction · 0.85
nowMethod · 0.45

Tested by

no test coverage detected