diff --git a/changelog/change_add_rubyjard_debugger_calls_to.md b/changelog/change_add_rubyjard_debugger_calls_to.md new file mode 100644 index 00000000000..0531399d8a5 --- /dev/null +++ b/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][]) diff --git a/config/default.yml b/config/default.yml index 53e201581c4..19b36715d67 100644 --- a/config/default.yml +++ b/config/default.yml @@ -1527,6 +1527,8 @@ Lint/Debugger: Rails: - debugger - Kernel.debugger + RubyJard: + - jard WebConsole: - binding.console diff --git a/lib/rubocop/cop/lint/debugger.rb b/lib/rubocop/cop/lint/debugger.rb index 68f81384ecd..9f6b0697e23 100644 --- a/lib/rubocop/cop/lint/debugger.rb +++ b/lib/rubocop/cop/lint/debugger.rb @@ -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: # diff --git a/spec/rubocop/cop/lint/debugger_spec.rb b/spec/rubocop/cop/lint/debugger_spec.rb index 61a9c5cb3dd..33fa76afeea 100644 --- a/spec/rubocop/cop/lint/debugger_spec.rb +++ b/spec/rubocop/cop/lint/debugger_spec.rb @@ -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)