dev-cmd/contributions: Pass from
correctly through count_reviews
too
This commit is contained in:
parent
808cfda92d
commit
1f9c764a69
@ -169,7 +169,7 @@ module Homebrew
|
|||||||
author: author_commits,
|
author: author_commits,
|
||||||
committer: committer_commits,
|
committer: committer_commits,
|
||||||
coauthorship: git_log_trailers_cmd(T.must(repo_path), person, "Co-authored-by", from:, to: args.to),
|
coauthorship: git_log_trailers_cmd(T.must(repo_path), person, "Co-authored-by", from:, to: args.to),
|
||||||
review: count_reviews(repo_full_name, person),
|
review: count_reviews(repo_full_name, person, from:, to: args.to),
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -202,9 +202,12 @@ module Homebrew
|
|||||||
Utils.safe_popen_read(*cmd).lines.count { |l| l.include?(person) }
|
Utils.safe_popen_read(*cmd).lines.count { |l| l.include?(person) }
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(repo_full_name: String, person: String).returns(Integer) }
|
sig {
|
||||||
def count_reviews(repo_full_name, person)
|
params(repo_full_name: String, person: String, from: T.nilable(String),
|
||||||
GitHub.count_issues("", is: "pr", repo: repo_full_name, reviewed_by: person, review: "approved", args:)
|
to: T.nilable(String)).returns(Integer)
|
||||||
|
}
|
||||||
|
def count_reviews(repo_full_name, person, from:, to:)
|
||||||
|
GitHub.count_issues("", is: "pr", repo: repo_full_name, reviewed_by: person, review: "approved", from:, to:)
|
||||||
rescue GitHub::API::ValidationFailedError
|
rescue GitHub::API::ValidationFailedError
|
||||||
if args.verbose?
|
if args.verbose?
|
||||||
onoe "Couldn't search GitHub for PRs by #{person}. Their profile might be private. Defaulting to 0."
|
onoe "Couldn't search GitHub for PRs by #{person}. Their profile might be private. Defaulting to 0."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user