diff --git a/Library/Contributions/examples/brew-audit.rb b/Library/Contributions/examples/brew-audit.rb index 2afcb05c67..b968ef3273 100755 --- a/Library/Contributions/examples/brew-audit.rb +++ b/Library/Contributions/examples/brew-audit.rb @@ -103,15 +103,28 @@ def audit_formula_options f, text return problems end +def audit_formula_instance f + problems = [] + + # Don't depend_on aliases; use full name + aliases = Formula.aliases + f.deps.select {|d| aliases.include? d}.each do |d| + problems << " * Dep #{d} is an alias; switch to the real name." + end + + # Google Code homepages should end in a slash + if f.homepage =~ %r[^https?://code\.google\.com/p/[^/]+[^/]$] + problems << " * Google Code homepage should end with a slash." + end + + return problems +end + def audit_some_formulae ff.each do |f| problems = [] - # Don't depend_on aliases; use full name - aliases = Formula.aliases - f.deps.select {|d| aliases.include? d}.each do |d| - problems << " * Dep #{d} is an alias; switch to the real name." - end + problems += audit_formula_instance f text = "" File.open(f.path, "r") { |afile| text = afile.read }