contributions: move CSV require into #generate_csv
CSV generation is optional, so this moves the related `require` into the method where `CSV` is used (following a pattern we've used for other `require` calls throughout `brew`).
This commit is contained in:
parent
a9f7da36e0
commit
b4b984e968
@ -2,10 +2,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "abstract_command"
|
require "abstract_command"
|
||||||
require "warnings"
|
|
||||||
Warnings.ignore :default_gems do
|
|
||||||
require "csv"
|
|
||||||
end
|
|
||||||
require "tap"
|
require "tap"
|
||||||
require "utils/github"
|
require "utils/github"
|
||||||
|
|
||||||
@ -120,6 +116,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]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user