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

FirstParameterIndentation and Rubymine 4-spaces continued indentations #2560

Closed
maia opened this issue Dec 30, 2015 · 2 comments
Closed

FirstParameterIndentation and Rubymine 4-spaces continued indentations #2560

maia opened this issue Dec 30, 2015 · 2 comments

Comments

@maia
Copy link

maia commented Dec 30, 2015

Rubymine will (per default) use 4-spaces indentation in multi lines (hashes, method calls, etc), causing a problem with Style/FirstParameterIndentation:

$ cat test.rb
class Test < ActiveRecord::Base
  def do_something
    update(
        column_a: some_value,
        column_b: other_value
    )
  end
end

Style/FirstParameterIndentation sees a problem here:

$ rubocop test.rb --only Style/FirstParameterIndentation
Inspecting 1 file
C

Offenses:

test.rb:4:9: C: Indent the first parameter one step more than the start of the previous line.
        column_a: some_value,
        ^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected

The Rubymine settings are:

[ ] Use tab character
Tab size: 2
Indent: 2
Continuation indent: 4
[ ] Keep indents on empty lines
[x] Use indents relative to expression start

There was a related problem with multi line method calls at #1633 which was fixed by @jonas054 by adding MultilineMethodCallIndentation. What can be done with FirstParameterIndentation?

@alexdowad
Copy link
Contributor

Working on a fix for this one.

@maia
Copy link
Author

maia commented Jan 7, 2016

Thanks!

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