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

Lint/EndAlignment: AlignWith: variable #2574

Closed
bquorning opened this issue Jan 3, 2016 · 1 comment
Closed

Lint/EndAlignment: AlignWith: variable #2574

bquorning opened this issue Jan 3, 2016 · 1 comment

Comments

@bquorning
Copy link
Contributor

@alexdowad It looks like #2539 broke Lint/EndAlignment with AlignWith: variable configuration:

» cat .rubocop.yml
Lint/EndAlignment:
  AlignWith: variable

» cat test.rb
# encoding: utf-8
# Documentation for Foo
class Foo
  def bar
  end
end

» ./bin/rubocop -d test.rb
For /Users/bquorning/Code/rubocop: configuration from /Users/bquorning/Code/rubocop/.rubocop.yml
Default configuration from /Users/bquorning/Code/rubocop/config/default.yml
Inheriting configuration from /Users/bquorning/Code/rubocop/config/enabled.yml
Inheriting configuration from /Users/bquorning/Code/rubocop/config/disabled.yml
Inspecting 1 file
Scanning /Users/bquorning/Code/rubocop/test.rb
An error occurred while Lint/EndAlignment cop was inspecting /Users/bquorning/Code/rubocop/test.rb.
undefined method `source' for nil:NilClass
/Users/bquorning/Code/rubocop/lib/rubocop/cop/mixin/end_keyword_alignment.rb:31:in `check_end_kw_alignment'
/Users/bquorning/Code/rubocop/lib/rubocop/cop/lint/end_alignment.rb:102:in `check_other_alignment'
/Users/bquorning/Code/rubocop/lib/rubocop/cop/lint/end_alignment.rb:39:in `on_class'
/Users/bquorning/Code/rubocop/lib/rubocop/cop/commissioner.rb:37:in `block (2 levels) in on_class'
/Users/bquorning/Code/rubocop/lib/rubocop/cop/commissioner.rb:87:in `with_cop_error_handling'
/Users/bquorning/Code/rubocop/lib/rubocop/cop/commissioner.rb:36:in `block in on_class'
/Users/bquorning/Code/rubocop/lib/rubocop/cop/commissioner.rb:34:in `each'
/Users/bquorning/Code/rubocop/lib/rubocop/cop/commissioner.rb:34:in `on_class'
/Users/bquorning/.gem/ruby/2.2.3/gems/ast-2.2.0/lib/ast/processor/mixin.rb:259:in `process'
/Users/bquorning/Code/rubocop/lib/rubocop/cop/commissioner.rb:53:in `investigate'
/Users/bquorning/Code/rubocop/lib/rubocop/cop/team.rb:36:in `inspect_file'
/Users/bquorning/Code/rubocop/lib/rubocop/runner.rb:206:in `inspect_file'
/Users/bquorning/Code/rubocop/lib/rubocop/runner.rb:172:in `block in do_inspection_loop'
/Users/bquorning/Code/rubocop/lib/rubocop/runner.rb:166:in `loop'
/Users/bquorning/Code/rubocop/lib/rubocop/runner.rb:166:in `do_inspection_loop'
/Users/bquorning/Code/rubocop/lib/rubocop/runner.rb:91:in `process_file'
/Users/bquorning/Code/rubocop/lib/rubocop/runner.rb:58:in `block in inspect_files'
/Users/bquorning/Code/rubocop/lib/rubocop/runner.rb:56:in `each'
/Users/bquorning/Code/rubocop/lib/rubocop/runner.rb:56:in `inspect_files'
/Users/bquorning/Code/rubocop/lib/rubocop/runner.rb:34:in `run'
/Users/bquorning/Code/rubocop/lib/rubocop/cli.rb:29:in `run'
./bin/rubocop:13:in `block in <main>'
/Users/bquorning/.rubies/ruby-2.2.3/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
./bin/rubocop:12:in `<main>'
.

1 file inspected, no offenses detected

1 error occurred:
An error occurred while Lint/EndAlignment cop was inspecting /Users/bquorning/Code/rubocop/test.rb.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
Mention the following information in the issue report:
0.35.1 (using Parser 2.3.0.pre.6, running on ruby 2.2.3 x86_64-darwin13)
Finished in 0.09646250499645248 seconds
@alexdowad
Copy link
Contributor

Thanks @bquorning! Just pushing a fix to my open PR. Also found and fixed another bug with Lint/EndAlignment while working on this one.

@bbatsov bbatsov closed this as completed in 0beb81a Jan 5, 2016
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

No branches or pull requests

2 participants