diff options
| author | Gautham Goli | 2017-08-14 02:43:54 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-08-14 02:43:54 +0530 |
| commit | 5a7cbb762f1a9e715ae03e82eb6cb8ef4ac4a0bb (patch) | |
| tree | f0fc617a0988b25ab646d639a00a2f212577301c /Library/Homebrew/rubocops | |
| parent | 02a1406a2e4c2d0506861248eb767d99f5ce4515 (diff) | |
| download | brew-5a7cbb762f1a9e715ae03e82eb6cb8ef4ac4a0bb.tar.bz2 | |
add test for build.with? "--with-foo"
Diffstat (limited to 'Library/Homebrew/rubocops')
| -rw-r--r-- | Library/Homebrew/rubocops/lines_cop.rb | 12 |
1 files changed, 6 insertions, 6 deletions
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)?-(.*)}) |
