diff options
| author | Adam Vandenberg | 2010-09-08 09:07:59 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-09-08 09:07:59 -0700 |
| commit | b98d8366bcf44d4db82eba48a2a420e7dc2cc5be (patch) | |
| tree | 9726a6b2f9e9ecdd2b28b164e531b7d1e6595381 /Library | |
| parent | bb3f9c4f3e16997c23e34026cd8499cf093a899f (diff) | |
| download | brew-b98d8366bcf44d4db82eba48a2a420e7dc2cc5be.tar.bz2 | |
brew-audit - check inreplace block var name
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/examples/brew-audit.rb | 5 |
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}" |
