From 6c9c3c607c0585e5361e272e976f3895f87263a4 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Thu, 10 Feb 2022 06:57:46 +0800 Subject: [PATCH] formula_auditor: disallow external tap dependencies in core Occasionally, we get PRs that attempt to add a dependency on a formula in an external tap in homebrew/core (e.g. Homebrew/homebrew-core#94791). We don't actually have an audit that disallows that. We should have one. --- Library/Homebrew/formula_auditor.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index b5093730bf..853a788a6e 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -289,6 +289,13 @@ module Homebrew next unless @core_tap + unless dep_f.tap.core_tap? + problem <<~EOS + Dependency '#{dep.name}' is not in homebrew/core. Formulae in homebrew/core + should not have dependencies in external taps. + EOS + end + # we want to allow uses_from_macos for aliases but not bare dependencies if self.class.aliases.include?(dep.name) && spec.uses_from_macos_names.exclude?(dep.name) problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'."