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 save_screenshot from Lint/Debugger #7853

Closed
Closed
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,10 @@
* [#7834](https://github.com/rubocop-hq/rubocop/issues/7834): Fix `Lint/UriRegexp` to register offense with array arguments. ([@tejasbubane][])
* [#7841](https://github.com/rubocop-hq/rubocop/issues/7841): Fix an error for `Style/TrailingCommaInBlockArgs` when lambda literal (`->`) has multiple arguments. ([@koic][])

### Changes

* Remove Capybara's `save_screenshot` from `Lint/Debugger`. ([@AndrewKvalheim][])

## 0.81.0 (2020-04-01)

### New features
Expand Down Expand Up @@ -4434,3 +4438,4 @@
[@dmolesUC]: https://github.com/dmolesUC
[@yuritomanek]: https://github.com/yuritomanek
[@egze]: https://github.com/egze
[@AndrewKvalheim]: https://github.com/AndrewKvalheim
3 changes: 1 addition & 2 deletions lib/rubocop/cop/lint/debugger.rb
Expand Up @@ -48,8 +48,7 @@ class Debugger < Cop
{:pry :remote_pry :pry_remote :console} ...)
(send (const {nil? (cbase)} :Pry) :rescue ...)
(send nil? {:save_and_open_page
:save_and_open_screenshot
:save_screenshot} ...)}
:save_and_open_screenshot} ...)}
PATTERN

def_node_matcher :binding_irb_call?, <<~PATTERN
Expand Down
8 changes: 1 addition & 7 deletions spec/rubocop/cop/lint/debugger_spec.rb
Expand Up @@ -27,9 +27,6 @@
include_examples 'debugger',
'capybara debug method',
'save_and_open_screenshot'
include_examples 'debugger',
'capybara debug method',
'save_screenshot'
include_examples 'debugger', 'debugger with an argument', 'debugger foo'
include_examples 'debugger', 'byebug with an argument', 'byebug foo'
include_examples 'debugger',
Expand All @@ -47,9 +44,6 @@
include_examples 'debugger',
'capybara debug method with an argument',
'save_and_open_screenshot foo'
include_examples 'debugger',
'capybara debug method with an argument',
'save_screenshot foo'

include_examples 'debugger', 'remote_byebug', 'remote_byebug'
include_examples 'debugger', 'web console binding', 'binding.console'
Expand All @@ -68,7 +62,7 @@

ALL_COMMANDS = %w[debugger byebug console pry remote_pry pry_remote irb
save_and_open_page save_and_open_screenshot
save_screenshot remote_byebug].freeze
remote_byebug].freeze

ALL_COMMANDS.each do |src|
it "does not report an offense for a #{src} in comments" do
Expand Down