From b98d8366bcf44d4db82eba48a2a420e7dc2cc5be Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 8 Sep 2010 09:07:59 -0700 Subject: brew-audit - check inreplace block var name --- Library/Contributions/examples/brew-audit.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Library') 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 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}" -- cgit v1.2.3