Merge pull request #10115 from bayandin/do-not-depend-on-aliases

formula_auditor: do not allow depending on aliases
This commit is contained in:
Alexander Bayandin 2020-12-24 18:13:39 +00:00 committed by GitHub
commit 5a7b70a41b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,12 +235,6 @@ module Homebrew
problem "Dependency '#{dep.name}' was renamed; use new name '#{dep_f.name}'." problem "Dependency '#{dep.name}' was renamed; use new name '#{dep_f.name}'."
end end
if self.class.aliases.include?(dep.name) &&
dep_f.core_formula? && !dep_f.versioned_formula?
problem "Dependency '#{dep.name}' from homebrew/core is an alias; " \
"use the canonical name '#{dep.to_formula.full_name}'."
end
if @core_tap && if @core_tap &&
@new_formula && @new_formula &&
dep_f.keg_only? && dep_f.keg_only? &&
@ -273,6 +267,10 @@ module Homebrew
next unless @core_tap next unless @core_tap
if self.class.aliases.include?(dep.name)
problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'."
end
if dep.tags.include?(:recommended) || dep.tags.include?(:optional) if dep.tags.include?(:recommended) || dep.tags.include?(:optional)
problem "Formulae in homebrew/core should not have optional or recommended dependencies" problem "Formulae in homebrew/core should not have optional or recommended dependencies"
end end