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:
Sam Ford 2024-07-18 11:22:39 -04:00
parent a9f7da36e0
commit b4b984e968
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D

View File

@ -2,10 +2,6 @@
# frozen_string_literal: true
require "abstract_command"
require "warnings"
Warnings.ignore :default_gems do
require "csv"
end
require "tap"
require "utils/github"
@ -120,6 +116,11 @@ module Homebrew
sig { params(totals: T::Hash[String, T::Hash[Symbol, Integer]]).returns(String) }
def generate_csv(totals)
require "warnings"
Warnings.ignore :default_gems do
require "csv"
end
CSV.generate do |csv|
csv << %w[user repo author committer coauthor review total]