Merge pull request #17806 from samford/contributions-add-missing-requires
contributions, github: add missing requires, fix type errors
This commit is contained in:
commit
41e362f9e0
@ -2,10 +2,8 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "abstract_command"
|
require "abstract_command"
|
||||||
require "warnings"
|
require "tap"
|
||||||
Warnings.ignore :default_gems do
|
require "utils/github"
|
||||||
require "csv"
|
|
||||||
end
|
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module DevCmd
|
module DevCmd
|
||||||
@ -50,12 +48,20 @@ module Homebrew
|
|||||||
results = {}
|
results = {}
|
||||||
grand_totals = {}
|
grand_totals = {}
|
||||||
|
|
||||||
repos = if args.repositories.blank? || args.repositories&.include?("primary")
|
repos = T.must(
|
||||||
|
if args.repositories.blank? || args.repositories&.include?("primary")
|
||||||
PRIMARY_REPOS
|
PRIMARY_REPOS
|
||||||
elsif args.repositories&.include?("all")
|
elsif args.repositories&.include?("all")
|
||||||
SUPPORTED_REPOS
|
SUPPORTED_REPOS
|
||||||
else
|
else
|
||||||
args.repositories
|
args.repositories
|
||||||
|
end,
|
||||||
|
)
|
||||||
|
|
||||||
|
repos.each do |repo|
|
||||||
|
if SUPPORTED_REPOS.exclude?(repo)
|
||||||
|
odie "Unsupported repository: #{repo}. Try one of #{SUPPORTED_REPOS.join(", ")}."
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
from = args.from.presence || Date.today.prev_year.iso8601
|
from = args.from.presence || Date.today.prev_year.iso8601
|
||||||
@ -118,6 +124,11 @@ module Homebrew
|
|||||||
|
|
||||||
sig { params(totals: T::Hash[String, T::Hash[Symbol, Integer]]).returns(String) }
|
sig { params(totals: T::Hash[String, T::Hash[Symbol, Integer]]).returns(String) }
|
||||||
def generate_csv(totals)
|
def generate_csv(totals)
|
||||||
|
require "warnings"
|
||||||
|
Warnings.ignore :default_gems do
|
||||||
|
require "csv"
|
||||||
|
end
|
||||||
|
|
||||||
CSV.generate do |csv|
|
CSV.generate do |csv|
|
||||||
csv << %w[user repo author committer coauthor review total]
|
csv << %w[user repo author committer coauthor review total]
|
||||||
|
|
||||||
@ -147,17 +158,18 @@ module Homebrew
|
|||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(repos: T.nilable(T::Array[String]), person: String, from: String).void }
|
sig {
|
||||||
|
params(
|
||||||
|
repos: T::Array[String],
|
||||||
|
person: String,
|
||||||
|
from: String,
|
||||||
|
).returns(T::Hash[Symbol, T.untyped])
|
||||||
|
}
|
||||||
def scan_repositories(repos, person, from:)
|
def scan_repositories(repos, person, from:)
|
||||||
return if repos.blank?
|
|
||||||
|
|
||||||
data = {}
|
data = {}
|
||||||
|
return data if repos.blank?
|
||||||
|
|
||||||
repos.each do |repo|
|
repos.each do |repo|
|
||||||
if SUPPORTED_REPOS.exclude?(repo)
|
|
||||||
return ofail "Unsupported repository: #{repo}. Try one of #{SUPPORTED_REPOS.join(", ")}."
|
|
||||||
end
|
|
||||||
|
|
||||||
repo_path = find_repo_path_for_repo(repo)
|
repo_path = find_repo_path_for_repo(repo)
|
||||||
tap = Tap.fetch("homebrew", repo)
|
tap = Tap.fetch("homebrew", repo)
|
||||||
unless repo_path.exist?
|
unless repo_path.exist?
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "uri"
|
require "uri"
|
||||||
|
require "utils/curl"
|
||||||
|
require "utils/popen"
|
||||||
require "utils/github/actions"
|
require "utils/github/actions"
|
||||||
require "utils/github/api"
|
require "utils/github/api"
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
require "system_command"
|
require "system_command"
|
||||||
require "tempfile"
|
require "tempfile"
|
||||||
|
require "utils/curl"
|
||||||
require "utils/shell"
|
require "utils/shell"
|
||||||
require "utils/formatter"
|
require "utils/formatter"
|
||||||
require "utils/uid"
|
require "utils/uid"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user