Skip to content

Commit

Permalink
Merge pull request #17407 from Homebrew/issyl0-patch-1
Browse files Browse the repository at this point in the history
dev-cmd/contributions: ‘Coauthorship’ sounds weird
  • Loading branch information
ZhongRuoyu authored Jun 2, 2024
2 parents c6368be + da78bcf commit 11f042e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Library/Homebrew/dev-cmd/contributions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def run

from = args.from.presence || Date.today.prev_year.iso8601

contribution_types = [:author, :committer, :coauthorship, :review]
contribution_types = [:author, :committer, :coauthor, :review]

users = args.user.presence || GitHub.members_by_team("Homebrew", "maintainers").keys
users.each do |username|
Expand Down Expand Up @@ -119,7 +119,7 @@ def time_period(from:, to:)
sig { params(totals: Hash).returns(String) }
def generate_csv(totals)
CSV.generate do |csv|
csv << %w[user repo author committer coauthorship review total]
csv << %w[user repo author committer coauthor review total]

totals.sort_by { |_, v| -v.values.sum }.each do |user, total|
csv << grand_total_row(user, total)
Expand All @@ -134,7 +134,7 @@ def grand_total_row(user, grand_total)
"all",
grand_total[:author],
grand_total[:committer],
grand_total[:coauthorship],
grand_total[:coauthor],
grand_total[:review],
grand_total.values.sum,
]
Expand Down Expand Up @@ -166,10 +166,10 @@ def scan_repositories(repos, person, from:)
author_commits, committer_commits = GitHub.count_repo_commits(repo_full_name, person,
from:, to: args.to, max: MAX_REPO_COMMITS)
data[repo] = {
author: author_commits,
committer: committer_commits,
coauthorship: git_log_trailers_cmd(T.must(repo_path), person, "Co-authored-by", from:, to: args.to),
review: count_reviews(repo_full_name, person, from:, to: args.to),
author: author_commits,
committer: committer_commits,
coauthor: git_log_trailers_cmd(T.must(repo_path), person, "Co-authored-by", from:, to: args.to),
review: count_reviews(repo_full_name, person, from:, to: args.to),
}
end

Expand All @@ -178,7 +178,7 @@ def scan_repositories(repos, person, from:)

sig { params(results: Hash).returns(Hash) }
def total(results)
totals = { author: 0, committer: 0, coauthorship: 0, review: 0 }
totals = { author: 0, committer: 0, coauthor: 0, review: 0 }

results.each_value do |counts|
counts.each do |kind, count|
Expand Down

0 comments on commit 11f042e

Please sign in to comment.