diff options
| author | Adam Vandenberg | 2010-08-21 11:55:57 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-08-21 12:00:38 -0700 |
| commit | d0a7049535365c5ef28c9d762366be24c0b57886 (patch) | |
| tree | 7965858ec18f2c07c309c11c910cee8109e0e8d4 | |
| parent | 50bcbf62716b167afdb7124f3982b52d421cda33 (diff) | |
| download | homebrew-d0a7049535365c5ef28c9d762366be24c0b57886.tar.bz2 | |
brew audit - Google Code homes w/o trailing slash
Without a trailing slash, you redirect to the URL w/ a slash, so
might as well have it there in the first place.
| -rwxr-xr-x | Library/Contributions/examples/brew-audit.rb | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/Library/Contributions/examples/brew-audit.rb b/Library/Contributions/examples/brew-audit.rb index 2afcb05c6..b968ef327 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 } |
