dev-cmd/contributions: Tidy up comments for data structures

- People can `pp results` or `pp totals`, updating these is getting tedious.
This commit is contained in:
Issy Long 2023-03-01 23:45:08 +00:00
parent 9250a6705e
commit 4be55ddcc4
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -193,17 +193,13 @@ module Homebrew
def total(results) def total(results)
totals = { author: 0, committer: 0, coauthorships: 0, reviews: 0 } totals = { author: 0, committer: 0, coauthorships: 0, reviews: 0 }
# {
# "brew"=>{:commits=>9,:coauthorships=>6,:reviews=>1},
# "core"=>{:commits=>15,:coauthorships=>10,:reviews=>2}
# }
results.each_value do |counts| results.each_value do |counts|
counts.each do |kind, count| counts.each do |kind, count|
totals[kind] += count totals[kind] += count
end end
end end
totals # {:commits=>24,:coauthorships=>16,:reviews=>3} totals
end end
sig { params(repo_path: Pathname, person: String, trailer: String, args: Homebrew::CLI::Args).returns(Integer) } sig { params(repo_path: Pathname, person: String, trailer: String, args: Homebrew::CLI::Args).returns(Integer) }