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

Style/EvalWithLocation reports bad line offset #5273

Closed
agross opened this issue Dec 18, 2017 · 0 comments
Closed

Style/EvalWithLocation reports bad line offset #5273

agross opened this issue Dec 18, 2017 · 0 comments
Labels

Comments

@agross
Copy link

agross commented Dec 18, 2017

Expected behavior

Message: Style/EvalWithLocation: Use __LINE__ - 3 instead of __LINE__, as they are used by backtraces.

Actual behavior

Message: Style/EvalWithLocation: Use __LINE__ - -3 instead of __LINE__, as they are used by backtraces.

Note: The line offset would be +3 if you followed the message.

Steps to reproduce the problem

eval('puts 42',
     binding,
     __FILE__,
     __LINE__)

RuboCop version

Include the output of rubocop -V. Here's an example:

$ rubocop -V
0.52.0 (using Parser 2.4.0.2, running on ruby 2.4.1 x64-mingw32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants