From b4b984e968be2a61178bdcdf6d7a01c98367e6c9 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Thu, 18 Jul 2024 11:22:39 -0400 Subject: [PATCH] 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`). --- Library/Homebrew/dev-cmd/contributions.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/dev-cmd/contributions.rb b/Library/Homebrew/dev-cmd/contributions.rb index b9085405d3..dbad695b9f 100644 --- a/Library/Homebrew/dev-cmd/contributions.rb +++ b/Library/Homebrew/dev-cmd/contributions.rb @@ -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]