-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Let the Debugger cop also check for byebug calls #969
Conversation
inspect_source(cop, src) | ||
expect(cop.offenses).to be_empty | ||
end | ||
|
||
it 'does not report an offense for a debugger or pry method' do | ||
it 'does not report an offense for a debugger, byebug or pry method' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should split this into several separate examples (you can generate them on-the-fly with some loop).
Rebased on master, split the spec & fixed the changelog entry. |
@@ -24,16 +30,18 @@ | |||
expect(cop.offenses).to be_empty | |||
end | |||
|
|||
it 'does not report an offense for debugger in comments' do | |||
src = ['# debugger'] | |||
it 'does not report an offense for debugger or byebug in comments' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will split this example in 2 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Let the Debugger cop also check for byebug calls
Thanks! |
Byebug is a popular debugger that works with Ruby 2 (which Debugger doesn’t). Would it be ok to add a
byebug
as we’ve done here, or should it rather be a separate cop?