audit: catch unnecessary 'ENV.foo' interpolation

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-06-17 17:58:49 -05:00
parent 58d4a95ea7
commit 38a28285a6

View File

@ -53,7 +53,7 @@ def audit_formula_text name, text
end end
# Check for string interpolation of single values. # Check for string interpolation of single values.
if text =~ /(system|inreplace|gsub!|change_make_var!) .* ['"]#\{(\w+)\}['"]/ if text =~ /(system|inreplace|gsub!|change_make_var!) .* ['"]#\{(\w+(\.\w+)?)\}['"]/
problems << " * Don't need to interpolate \"#{$2}\" with #{$1}" problems << " * Don't need to interpolate \"#{$2}\" with #{$1}"
end end