aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-09-08 09:07:59 -0700
committerAdam Vandenberg2010-09-08 09:07:59 -0700
commitb98d8366bcf44d4db82eba48a2a420e7dc2cc5be (patch)
tree9726a6b2f9e9ecdd2b28b164e531b7d1e6595381 /Library
parentbb3f9c4f3e16997c23e34026cd8499cf093a899f (diff)
downloadbrew-b98d8366bcf44d4db82eba48a2a420e7dc2cc5be.tar.bz2
brew-audit - check inreplace block var name
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/examples/brew-audit.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Contributions/examples/brew-audit.rb b/Library/Contributions/examples/brew-audit.rb
index b9c36e00b..4d2c08e26 100755
--- a/Library/Contributions/examples/brew-audit.rb
+++ b/Library/Contributions/examples/brew-audit.rb
@@ -29,6 +29,11 @@ def audit_formula_text text
problems << " * Don't need 'FileUtils.' before #{$1}."
end
+ # Check for long inreplace block vars
+ if text =~ /inreplace .* do \|(.{2,})\|/
+ problems << " * \"inreplace <filenames> do |s|\" is preferred over \"|#{$1}|\"."
+ end
+
# Check for string interpolation of single values.
if text =~ /(system|inreplace|gsub!|change_make_var!) .* ['"]#\{(\w+)\}['"]/
problems << " * Don't need to interpolate \"#{$2}\" with #{$1}"