From 5a7cbb762f1a9e715ae03e82eb6cb8ef4ac4a0bb Mon Sep 17 00:00:00 2001 From: Gautham Goli Date: Mon, 14 Aug 2017 02:43:54 +0530 Subject: add test for build.with? "--with-foo" --- 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 d6dba9061..5ed9acc93 100644 --- a/Library/Homebrew/rubocops/lines_cop.rb +++ b/Library/Homebrew/rubocops/lines_cop.rb @@ -303,12 +303,12 @@ module RuboCop problem "Don't duplicate 'without': Use `build.without? \"#{match[1]}\"` to check for \"--without-#{match[1]}\"" end - # find_instance_method_call(body_node, :build, :with?) do |m| - # arg = parameters(m).first - # next unless match = regex_match_group(arg, %r{-?-?with-(.*)}) - # problem "Don't duplicate 'with': Use `build.with? \"#{match[1]}\"` to check for \"--with-#{match[1]}\"" - # end - # + find_instance_method_call(body_node, :build, :with?) do |m| + arg = parameters(m).first + next unless match = regex_match_group(arg, %r{-?-?with-(.*)}) + problem "Don't duplicate 'with': Use `build.with? \"#{match[1]}\"` to check for \"--with-#{match[1]}\"" + end + # find_instance_method_call(body_node, :build, :include?) do |m| # arg = parameters(m).first # next unless match = regex_match_group(arg, %r{with(out)?-(.*)}) -- cgit v1.2.3