audit: loop over deps once
This commit is contained in:
parent
73d08fcc1a
commit
fb30041640
@ -114,16 +114,10 @@ class FormulaAuditor
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@aliases ||= Formula.aliases
|
||||||
|
|
||||||
def audit_deps
|
def audit_deps
|
||||||
# Don't depend_on aliases; use full name
|
|
||||||
@@aliases ||= Formula.aliases
|
|
||||||
|
|
||||||
@specs.each do |spec|
|
@specs.each do |spec|
|
||||||
spec.deps.select { |d| @@aliases.include? d.name }.each do |d|
|
|
||||||
real_name = d.to_formula.name
|
|
||||||
problem "Dependency '#{d}' is an alias; use the canonical name '#{real_name}'."
|
|
||||||
end
|
|
||||||
|
|
||||||
# Check for things we don't like to depend on.
|
# Check for things we don't like to depend on.
|
||||||
# We allow non-Homebrew installs whenever possible.
|
# We allow non-Homebrew installs whenever possible.
|
||||||
spec.deps.each do |dep|
|
spec.deps.each do |dep|
|
||||||
@ -137,6 +131,10 @@ class FormulaAuditor
|
|||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if @@aliases.include?(dep.name)
|
||||||
|
problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.name}'."
|
||||||
|
end
|
||||||
|
|
||||||
dep.options.reject do |opt|
|
dep.options.reject do |opt|
|
||||||
next true if dep_f.option_defined?(opt)
|
next true if dep_f.option_defined?(opt)
|
||||||
dep_f.requirements.detect do |r|
|
dep_f.requirements.detect do |r|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user