lines_cop: Add condition to prevent false positives

This commit is contained in:
Gautham Goli 2017-11-24 23:39:38 +05:30
parent 2af98133ba
commit 9be85385b3

View File

@ -331,6 +331,7 @@ module RuboCop
end end
find_instance_method_call(body_node, "Dir", :[]) do |method| find_instance_method_call(body_node, "Dir", :[]) do |method|
next unless parameters(method).size == 1
path = parameters(method).first path = parameters(method).first
next unless path.str_type? next unless path.str_type?
next unless match = regex_match_group(path, /^[^\*{},]+$/) next unless match = regex_match_group(path, /^[^\*{},]+$/)