diff --git a/Library/Contributions/examples/brew-audit.rb b/Library/Contributions/examples/brew-audit.rb index b9c36e00b5..4d2c08e26e 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}"