-
Notifications
You must be signed in to change notification settings - Fork 213
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
Inconsistent formatting on nested hashes #285
Comments
Huh, it looks like if I manually format it how I'd want to see it, Standard doesn't change it back, at least. This could be a case of Standard allowing both formats and ruby-vim just stubbornly indenting stuff way deeper than I'd like… workweek = New.new(Workweek,
started_on: START_DATE,
ended_on: END_DATE,
entries: ((START_DATE + 2)..END_DATE).map { |date|
New.new(Entry,
user: user,
project: project,
location: location,
assignment: assignment,
notes: "Some notes",
hours: 8,
entered_in_half_days: false)
}) |
I've also seen inconsistent behavior from vim-ruby like this but haven't dug deeper. |
@JoshCheek thanks! I'll give this a try |
That setting comes from here: https://github.com/vim-ruby/vim-ruby/blob/4788a08433c3c90e131fc7d110d82577e1234a86/doc/ft-ruby-indent.txt#L110-L146 |
I think this is an issue of standard/rubocop allowing both of these (given https://docs.rubocop.org/rubocop/1.17/cops_layout.html#enforcedlastargumenthashstyle-always_inspect-default) |
I just wrote this and the indentation level of the interior map seemed un-standard-like in how deep it was. I would have expected it to close (
})
) in alignment with the start of the key symbols.Actual behavior:
Expected Behavior
More general/typical case
Even if you eliminate the leading argument (which is on the same line as the invocation), the map block is indented unusually for Standard, which generally favors at most one level of additional indentation for everything
Actual behavior:
Expected behavior:
Thoughts on this? If anyone knows the Rubocop rule to fiddle with to achieve this, please enlighten me!
The text was updated successfully, but these errors were encountered: