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/IndentationWidth fails with private_class_method #2045

Closed
mseppae opened this issue Jul 16, 2015 · 0 comments
Closed

Style/IndentationWidth fails with private_class_method #2045

mseppae opened this issue Jul 16, 2015 · 0 comments
Labels

Comments

@mseppae
Copy link

mseppae commented Jul 16, 2015

Rubocop cop Style/IndentationWidth is failing with private_class_method syntax.

The class to test:

class Foo
  private_class_method def self.bar
    'bar'
  end
end

Error trace:

An error occurred while Style/IndentationWidth cop was inspecting /Users/mseppae/foo.rb.
undefined method `line' for nil:NilClass
/Users/mseppae/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/parser-2.2.2.6/lib/parser/source/map.rb:98:in `line'
/Users/mseppae/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rubocop-0.32.1/lib/rubocop/cop/style/indentation_width.rb:225:in `indentation_to_check?'
/Users/mseppae/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rubocop-0.32.1/lib/rubocop/cop/style/indentation_width.rb:201:in `check_indentation'
/Users/mseppae/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rubocop-0.32.1/lib/rubocop/cop/style/indentation_width.rb:97:in `on_send'
(eval):5:in `block (2 levels) in on_send'

System information:

Mention the following information in the issue report:
0.32.1 (using Parser 2.2.2.6, running on ruby 2.2.0 x86_64-darwin14)
@bbatsov bbatsov added the bug label Jul 16, 2015
bbatsov added a commit that referenced this issue Jul 21, 2015
[Fix #2045] Fix error on class method definition with modifier
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