Skip to content

Commit

Permalink
Merge pull request #7636 from gsamokovarov/console-ambiguity
Browse files Browse the repository at this point in the history
Remove `console` from `Lint/Debugger`
  • Loading branch information
koic committed Jan 9, 2020
2 parents d5334b9 + f274609 commit 1a6ef08
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

### Changes

* [#7636](https://github.com/rubocop-hq/rubocop/issues/7636): Remove `console` from `Lint/Debugger` to prevent false positives. ([@gsamokovarov][])

## 0.79.0 (2020-01-06)

### New features
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/lint/debugger.rb
Expand Up @@ -43,7 +43,7 @@ class Debugger < Cop
PATTERN

def_node_matcher :debugger_call?, <<~PATTERN
{(send {nil? #kernel?} {:debugger :byebug :remote_byebug :console} ...)
{(send {nil? #kernel?} {:debugger :byebug :remote_byebug} ...)
(send (send {#kernel? nil?} :binding)
{:pry :remote_pry :pry_remote :console} ...)
(send (const {nil? (cbase)} :Pry) :rescue ...)
Expand Down
2 changes: 0 additions & 2 deletions spec/rubocop/cop/lint/debugger_spec.rb
Expand Up @@ -52,7 +52,6 @@
'save_screenshot foo'

include_examples 'debugger', 'remote_byebug', 'remote_byebug'
include_examples 'debugger', 'web console', 'console'
include_examples 'debugger', 'web console binding', 'binding.console'

it 'does not report an offense for a non-pry binding' do
Expand All @@ -62,7 +61,6 @@
include_examples 'debugger', 'debugger with Kernel', 'Kernel.debugger'
include_examples 'debugger', 'debugger with ::Kernel', '::Kernel.debugger'
include_examples 'debugger', 'binding.pry with Kernel', 'Kernel.binding.pry'
include_examples 'debugger', 'web console with Kernel', 'Kernel.console'

it 'does not report an offense for save_and_open_page with Kernel' do
expect_no_offenses('Kernel.save_and_open_page')
Expand Down

0 comments on commit 1a6ef08

Please sign in to comment.