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

Error processing code with Style/ExtraSpacing #2113

Closed
rrosenblum opened this issue Aug 6, 2015 · 0 comments
Closed

Error processing code with Style/ExtraSpacing #2113

rrosenblum opened this issue Aug 6, 2015 · 0 comments
Assignees
Labels

Comments

@rrosenblum
Copy link
Contributor

This is happening in version 0.33.0 and master

Sample test

it 'exception' do
  source = ['{:a => "a",',
            ' :b => [nil,  2.5]}']

  inspect_source(cop, source)
end

Exception

RuboCop::Cop::Style::ExtraSpacing when AllowForAlignment is true exception
     Failure/Error: inspect_source(cop, source)
     NoMethodError:
       undefined method `[]' for 2.5:Float
     # ./lib/rubocop/cop/style/extra_spacing.rb:107:in `aligned_same_character?'
     # ./lib/rubocop/cop/style/extra_spacing.rb:82:in `block in aligned_with?'
     # ./lib/rubocop/cop/style/extra_spacing.rb:76:in `downto'
     # ./lib/rubocop/cop/style/extra_spacing.rb:76:in `each'
     # ./lib/rubocop/cop/style/extra_spacing.rb:76:in `aligned_with?'
     # ./lib/rubocop/cop/style/extra_spacing.rb:52:in `aligned_with_something?'
     # ./lib/rubocop/cop/style/extra_spacing.rb:28:in `block in investigate'
     # ./lib/rubocop/cop/style/extra_spacing.rb:24:in `each'
     # ./lib/rubocop/cop/style/extra_spacing.rb:24:in `each_cons'
     # ./lib/rubocop/cop/style/extra_spacing.rb:24:in `investigate'
@bbatsov bbatsov added the bug label Aug 7, 2015
@jonas054 jonas054 self-assigned this Aug 7, 2015
bbatsov added a commit that referenced this issue Aug 8, 2015
[Fix #2113] Handle non-string tokens in ExtraSpacing
Baelor added a commit to OmertaBeyond/omerta_logger that referenced this issue Aug 16, 2015
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

3 participants