From dc4d10ff6a59ce0da1bfc7bc06dd819c442813ab Mon Sep 17 00:00:00 2001 From: Gautham Goli Date: Mon, 14 Aug 2017 02:49:52 +0530 Subject: add test for build.include? having dashed args --- Library/Homebrew/rubocops/lines_cop.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Library/Homebrew/rubocops') diff --git a/Library/Homebrew/rubocops/lines_cop.rb b/Library/Homebrew/rubocops/lines_cop.rb index b6567466a..dac523424 100644 --- a/Library/Homebrew/rubocops/lines_cop.rb +++ b/Library/Homebrew/rubocops/lines_cop.rb @@ -314,12 +314,12 @@ module RuboCop next unless match = regex_match_group(arg, %r{with(out)?-(.*)}) problem "Use build.with#{match[1]}? \"#{match[2]}\" instead of build.include? 'with#{match[1]}-#{match[2]}'" end - # - # find_instance_method_call(body_node, :build, :include?) do |m| - # arg = parameters(m).first - # next unless match = regex_match_group(arg, %r{\-\-(.*)}) - # problem "Reference '#{match[1]}' without dashes" - # end + + find_instance_method_call(body_node, :build, :include?) do |m| + arg = parameters(m).first + next unless match = regex_match_group(arg, %r{\-\-(.*)}) + problem "Reference '#{match[1]}' without dashes" + end end -- cgit v1.2.3