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

IndentationConsistency with "EnforcedStyle: rails" does not work in Rails concerns #3494

Closed
5t111111 opened this issue Sep 14, 2016 · 0 comments

Comments

@5t111111
Copy link

5t111111 commented Sep 14, 2016

In Rails concerns, IndentationConsistency with "EnforcedStyle: rails" does not detect incorrect indentation.


Expected behavior

concern :Authenticatable do
  def foo
    puts "foo"
  end

  private

  def bar
    puts "bar"
  end
end

In the above code, the method bar should be indented to 1 more depth, but Rubocop does not complain about this.

Actual behavior

No inconsistent indentation is detected.

Steps to reproduce the problem

  1. Set IndentationConsistency with EnforcedStyle: rails in your Rubocop config
  2. Write the code contains inconsistent indentation in a concern block (the one in "Expected behavior" for example")
  3. Check the code by running Rubocop

RuboCop version

Include the output of rubocop -V:

$ rubocop -V
0.42.0 (using Parser 2.3.1.2, running on ruby 2.3.1 x86_64-darwin15)
@5t111111 5t111111 changed the title IndentationConsistency with "EnforcedStyle: rails" does not work in Rails IndentationConsistency with "EnforcedStyle: rails" does not work in Rails concerns Sep 14, 2016
jonas054 added a commit to jonas054/rubocop that referenced this issue Oct 23, 2016
…onWidth

IndentationWidth already checks the first statement inside a block,
and IndentationConsistency checks that each statement is aligned with
the previous one, but the special indentation that is indicated by
`IndentationConsistency: EnforcedStyle: rails` needs to be done for
blocks too, not just classes and modules.
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

1 participant