brew audit: --strict warning for using $ in caveats

For multiple lines of commands to enter at a prompt, don't use
$ as a prompt marker to make it easier to copy/paste.
This commit is contained in:
Adam Vandenberg 2011-04-04 16:40:38 -07:00
parent 11f3fca867
commit e788de8cf8

View File

@ -233,12 +233,23 @@ def audit_formula_instance f
return problems return problems
end end
def audit_formula_caveats f
problems = []
if f.caveats.to_s =~ /^\s*\$\s+/
problems << " * caveats should not use '$' prompts in multiline commands."
end if strict?
return problems
end
module Homebrew extend self module Homebrew extend self
def audit def audit
ff.each do |f| ff.each do |f|
problems = [] problems = []
problems += audit_formula_instance f problems += audit_formula_instance f
problems += audit_formula_urls f problems += audit_formula_urls f
problems += audit_formula_caveats f
perms = File.stat(f.path).mode perms = File.stat(f.path).mode
if perms.to_s(8) != "100644" if perms.to_s(8) != "100644"