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 a false positive for Lint/Debugger
when methods containing different method chains
#11552
Conversation
…erent method chains This PR is fix a false positive for `Lint/Debugger` when methods containing different method chains. ## Motivation I don't think that methods such as `p.do_something` for example should be an offense of this cop. I think it would be better to make it a violation only if it is an exact match, including the method chain, but what do you think? ## This PR will result in the following ```ruby # bad p 'foo' foo(p 'foo') p(p 'foo') # good p.do_something Foo.p ```
4f4bfeb
to
23cc42b
Compare
Yeah, I agree that's an improvement. Thanks! |
Thanks for all the work @ydah. Good job and it's deeply appreciated. ❤️ This has immediately created an issue on our end unfortunately. We use Maybe it makes sense to move |
|
Why not catching Can you guys reconsider? The current implementation will make us remove |
This PR rolls back the print debug default configuration (rubocop#11518) of `Lint/Debugger` based on the following feedback. - rubocop#11557 (comment) - rubocop#11552 (comment) - rubocop#11518 (comment) It seems like it was a bad idea to mix debugger and print debug methods by default. This PR updates `Lint/Debugger` cop defaults to handle only debugger methods as per the cop name. OTOH, it leaves the logic in rubocop#11557 to prevent false positives when user configures print debug methods. e.g. rubocop#11517 (comment)
I reconsidered based on some feedback and opened #11564. Thank you. |
Thank you. 👍 |
This PR rolls back the print debug default configuration (#11518) of `Lint/Debugger` based on the following feedback. - #11557 (comment) - #11552 (comment) - #11518 (comment) It seems like it was a bad idea to mix debugger and print debug methods by default. This PR updates `Lint/Debugger` cop defaults to handle only debugger methods as per the cop name. OTOH, it leaves the logic in #11557 to prevent false positives when user configures print debug methods. e.g. #11517 (comment)
This PR is fix a false positive for
Lint/Debugger
when methods containing different method chains.Motivation
I don't think that methods such as
p.do_something
for example should be an offense of this cop. I think it would be better to make it a violation only if it is an exact match, including the method chain, but what do you think?This PR will result in the following
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.