From be4e926b15ec58ff6273e6bf9377cfc8d11e57f9 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Wed, 24 Aug 2022 18:18:10 +0800 Subject: [PATCH] Fix `"dependencies"` being `nil`. --- Library/Homebrew/formula_auditor.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index b226eaf598..f394d01dad 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -888,11 +888,10 @@ module Homebrew # depends_on "gcc" # end # ``` - variations_deps = [] - variations.each_value do |data| - variations_deps += data["dependencies"] - end - variations_deps.uniq! + variations_deps = variations.values + .flat_map { |data| data["dependencies"] } + .compact + .uniq variations_deps.exclude?("gcc") end