Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove console from Lint/Debugger #7636

Merged
merged 1 commit into from Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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