aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorAdam Vandenberg2011-04-04 16:40:38 -0700
committerAdam Vandenberg2011-04-04 16:40:38 -0700
commite788de8cf81cd6bdd5e58429b1a77e61c2861afd (patch)
tree95032049a57eb43ecac0e54bc742703cc8b42724 /Library/Homebrew/cmd
parent11f3fca867feb67702e0a0b5dae9f9ace2c94197 (diff)
downloadbrew-e788de8cf81cd6bdd5e58429b1a77e61c2861afd.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew/cmd')
-rwxr-xr-xLibrary/Homebrew/cmd/audit.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index b4cc01bf0..3cc294c70 100755
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -233,12 +233,23 @@ def audit_formula_instance f
return problems
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
def audit
ff.each do |f|
problems = []
problems += audit_formula_instance f
problems += audit_formula_urls f
+ problems += audit_formula_caveats f
perms = File.stat(f.path).mode
if perms.to_s(8) != "100644"