aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/rubocops
diff options
context:
space:
mode:
authorGautham Goli2017-08-14 23:05:00 +0530
committerGautham Goli2017-08-14 23:05:00 +0530
commit64a929184a45f530a49af7b047d5b6605b50b1f8 (patch)
tree552e6aad8e6a60a3033bd2c0569391fee7f0a189 /Library/Homebrew/rubocops
parent063cbe7acdb0af0a4cd9bd35f29f89bc0d638d4a (diff)
downloadbrew-64a929184a45f530a49af7b047d5b6605b50b1f8.tar.bz2
add tests for vendored deps
Diffstat (limited to 'Library/Homebrew/rubocops')
-rw-r--r--Library/Homebrew/rubocops/lines_cop.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/Library/Homebrew/rubocops/lines_cop.rb b/Library/Homebrew/rubocops/lines_cop.rb
index d3640c9ef..6520018ac 100644
--- a/Library/Homebrew/rubocops/lines_cop.rb
+++ b/Library/Homebrew/rubocops/lines_cop.rb
@@ -135,14 +135,13 @@ module RuboCop
problem "\"\#\{prefix}#{match[1]}\" should be \"\#{#{match[2].downcase}}\""
end
end
+ find_every_method_call_by_name(body_node, :depends_on).each do |m|
+ key, value = destructure_hash(parameters(m).first)
+ next if (key.nil? || value.nil?)
+ next unless match = regex_match_group(value, %r{(lua|perl|python|ruby)(\d*)})
+ problem "#{match[1]} modules should be vendored rather than use deprecated #{m.source}`"
+ end
- # find_every_method_call_by_name(body_node, :depends_on) do |m|
- # key, value = destructure_hash(paramters(m).first)
- # next unless key.str_type?
- # next unless match = regex_match_group(value, %r{(lua|perl|python|ruby)(\d*)})
- # problem "#{match[1]} modules should be vendored rather than use deprecated #{m.source}`"
- # end
- #
# find_every_method_call_by_name(body_node, :system).each do |m|
# next unless match = regex_match_group(parameters(m).first, %r{(env|export)(\s+)?})
# problem "Use ENV instead of invoking '#{match[1]}' to modify the environment"
@@ -345,8 +344,8 @@ module RuboCop
$(hash (pair $(str _) (array $(str _) ...)))}
EOS
- def_node_search :destructure_hash, <<-EOS.undent
- (hash (pair $_ $_))
+ def_node_matcher :destructure_hash, <<-EOS.undent
+ (hash (pair $(str _) $(sym _)))
EOS
def_node_search :formula_path_strings, <<-EOS.undent