audit: catch unnecessary 'ENV.foo' interpolation
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
		
							parent
							
								
									58d4a95ea7
								
							
						
					
					
						commit
						38a28285a6
					
				@ -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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user