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

Parser exception: Parser::Source::Range .. spans more than one line #2287

Closed
matthewd opened this issue Sep 30, 2015 · 0 comments
Closed

Parser exception: Parser::Source::Range .. spans more than one line #2287

matthewd opened this issue Sep 30, 2015 · 0 comments
Labels

Comments

@matthewd
Copy link

0.34.2 (using Parser 2.2.2.6, running on ruby 2.2.2 x86_64-darwin14)

Given the exception, I guess this is ultimately an issue for Parser... but I wouldn't know where to start in isolating it for them.

% echo "def x\n\t   y\n \n\trescue\nend\n" > x.rb
% rubocop -a ./x.rb
Inspecting 1 file


0 files inspected, no offenses detected
#<Parser::Source::Range /Users/matthew/x4.rb 12...14> spans more than one line
parser-2.2.2.6/lib/parser/source/range.rb:113:in `column_range'
parser-2.2.2.6/lib/parser/diagnostic.rb:93:in `render'
parser-2.2.2.6/lib/parser/source/rewriter.rb:34:in `block in initialize'
parser-2.2.2.6/lib/parser/diagnostic/engine.rb:67:in `call'
parser-2.2.2.6/lib/parser/diagnostic/engine.rb:67:in `process'
parser-2.2.2.6/lib/parser/source/rewriter.rb:168:in `append'
parser-2.2.2.6/lib/parser/source/rewriter.rb:50:in `remove'
rubocop-0.34.2/lib/rubocop/cop/corrector.rb:56:in `remove'
rubocop-0.34.2/lib/rubocop/cop/mixin/autocorrect_alignment.rb:125:in `remove'
rubocop-0.34.2/lib/rubocop/cop/mixin/autocorrect_alignment.rb:85:in `autocorrect_line'
rubocop-0.34.2/lib/rubocop/cop/mixin/autocorrect_alignment.rb:66:in `block (2 levels) in autocorrect'
rubocop-0.34.2/lib/rubocop/cop/mixin/autocorrect_alignment.rb:139:in `block in each_line'
rubocop-0.34.2/lib/rubocop/cop/mixin/autocorrect_alignment.rb:137:in `each_line'
rubocop-0.34.2/lib/rubocop/cop/mixin/autocorrect_alignment.rb:137:in `each_line'
rubocop-0.34.2/lib/rubocop/cop/mixin/autocorrect_alignment.rb:65:in `block in autocorrect'
[..]
@bbatsov bbatsov added the bug label Oct 7, 2015
bbatsov added a commit that referenced this issue Oct 23, 2015
[Fix #2287] Fix alignment of whitespace lines
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