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

Let the Debugger cop also check for byebug calls #969

Merged
merged 1 commit into from
Apr 7, 2014

Conversation

bquorning
Copy link
Contributor

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?

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
Copy link
Collaborator

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).

@bquorning
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

bbatsov added a commit that referenced this pull request Apr 7, 2014
Let the Debugger cop also check for byebug calls
@bbatsov bbatsov merged commit e5ff30b into rubocop:master Apr 7, 2014
@bbatsov
Copy link
Collaborator

bbatsov commented Apr 7, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants