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