File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,20 @@ def check
1919
2020 # Iterate over each command found in any exec
2121 exec_resources . each do |command_resources |
22- # Iterate over each command in execs and check for unsafe interpolations
23- command_resources [ :tokens ] . each do |token |
24- # We are only interested in tokens from command onwards
25- next unless token . type == :NAME
26- # Don't check the command if it is parameterised
27- next if parameterised? ( token )
22+ check_unsafe_interpolations ( command_resources )
23+ end
24+ end
2825
29- check_command ( token ) . each do |t |
30- notify_warning ( t )
31- end
26+ # Iterates over tokens in a command and raises a warning if an interpolated variable is found
27+ def check_unsafe_interpolations ( command_resources )
28+ command_resources [ :tokens ] . each do |token |
29+ # We are only interested in tokens from command onwards
30+ next unless token . type == :NAME
31+ # Don't check the command if it is parameterised
32+ next if parameterised? ( token )
33+
34+ check_command ( token ) . each do |t |
35+ notify_warning ( t )
3236 end
3337 end
3438 end
You can’t perform that action at this time.
0 commit comments