Skip to content

Commit

Permalink
Merge pull request rubocop#10034 from DanielVartanov/master
Browse files Browse the repository at this point in the history
Add `RubyJard` debugger calls to Lint/Debugger/DebuggerMethods
  • Loading branch information
koic committed Aug 24, 2021
2 parents d41eeb1 + de2f22c commit 04dad00
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/change_add_rubyjard_debugger_calls_to.md
@@ -0,0 +1 @@
* [#10034](https://github.com/rubocop/rubocop/pull/10034): Add `RubyJard` debugger calls to Lint/Debugger/DebuggerMethods. ([@DanielVartanov][])
2 changes: 2 additions & 0 deletions config/default.yml
Expand Up @@ -1527,6 +1527,8 @@ Lint/Debugger:
Rails:
- debugger
- Kernel.debugger
RubyJard:
- jard
WebConsole:
- binding.console

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/lint/debugger.rb
Expand Up @@ -8,7 +8,7 @@ module Lint
#
# The cop can be configured using `DebuggerMethods`. By default, a number of gems
# debug entrypoints are configured (`Kernel`, `Byebug`, `Capybara`, `Pry`, `Rails`,
# and `WebConsole`). Additional methods can be added.
# `RubyJard` and `WebConsole`). Additional methods can be added.
#
# Specific default groups can be disabled if necessary:
#
Expand Down
9 changes: 9 additions & 0 deletions spec/rubocop/cop/lint/debugger_spec.rb
Expand Up @@ -218,6 +218,15 @@ def method
end
end

context 'RubyJard' do
it 'registers an offense for a jard call' do
expect_offense(<<~RUBY)
jard
^^^^ Remove debugger entry point `jard`.
RUBY
end
end

context 'web console' do
it 'registers an offense for a `binding.console` call' do
expect_offense(<<~RUBY)
Expand Down

0 comments on commit 04dad00

Please sign in to comment.