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

[Fix #9500] Update Lint/Debugger so that only specific receivers for debug methods lead to offenses #9504

Merged
merged 1 commit into from Feb 12, 2021

Commits on Feb 10, 2021

  1. [Fix rubocop#9500] Update Lint/Debugger so that only specific recei…

    …vers for debug methods lead to offenses.
    
    Prior to rubocop#8929, `Lint/Debugger` looked for a specific receiver/method pair, but that PR changed it so that any of the `DebuggerReceivers` would apply, *or also* no receiver. This caused regressions (rubocop#7636 and rubocop#9500, for instance) because method names specified as debugger by this cop would now register offenses when called with no receiver.
    
    In order to fix it, I changed the configuration for `Lint/Debugger` a bit, but in a way that should not cause any major incompatibility. The allow list is now specified including its receiver so that the receiver can be checked. Existing configurations that just pass in a method name will be treated as expecting no receiver (there's a slight incompatibility there because previously `foo` would be matched by `Kernel.foo` but I think this is ok (and is resolvable by adding `Kernel.foo` to the configuration).
    
    I've also grouped the debugger methods by source (it's often confusing to me where each method comes from), which also allows an end-user to disable a pre-defined group of methods by specifying `Byebug: ~` for example.
    
    Finally I've deprecated the `DebuggerReceivers` configuration as it is no longer useful.
    dvandersluis committed Feb 10, 2021
    Configuration menu
    Copy the full SHA
    ddc536a View commit details
    Browse the repository at this point in the history