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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gsamokovarov
force-pushed
the
console-ambiguity
branch
from
January 7, 2020 20:33
9711e7a
to
619152c
Compare
It's ambiguous and we can play games and try not to recognize: ```ruby console do with_a_block end ``` But, other use cases will come up. Web Console supports `binding.console`, which is safe to recognize by a linter, so let's drop the ambiguous `console` one.
gsamokovarov
force-pushed
the
console-ambiguity
branch
from
January 7, 2020 21:17
619152c
to
f274609
Compare
koic
approved these changes
Jan 8, 2020
bquorning
approved these changes
Jan 8, 2020
Thanks! |
|
Yep, it seems that's a regression. |
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this pull request
Feb 10, 2021
…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.
8 tasks
bbatsov
pushed a commit
that referenced
this pull request
Feb 12, 2021
…r debug methods lead to offenses. Prior to #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 (#7636 and #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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's ambiguous and we can play games and try not to recognize:
But, other use cases will come up. Web Console supports
binding.console
, which is safe to recognize, so let's dropthe ambiguous
console
one.