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

[Fix #10488] Add KeepAlignedDots option for Layout/MultilineMethodCallIndentation #10549

Conversation

nobuyo
Copy link
Contributor

@nobuyo nobuyo commented Apr 19, 2022

Fixes #10488.

The automatic correction by cop reported in the issue is syntactically correct, but it is also true that in this case we don't want it rewritten. We could switch them one by one with a comment directive, but it would be difficult if there are many, as in RSpec for example.

So I've added option to not break the dots if they are already aligned.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@koic
Copy link
Member

koic commented Apr 19, 2022

I think the current #10488 behavior is a bug. It should align the first dot, not the last dot. So, it's better to leave only this new behavior instead of the KeepAlignedDots option.

@nobuyo
Copy link
Contributor Author

nobuyo commented Apr 19, 2022

Thanks, I'll fix like that.

…lIndentation` breaks indentation for nesting of method calls
@nobuyo nobuyo force-pushed the add-new-option-for-multiline-method-call-indentation branch from f617b79 to c0a9b9e Compare April 19, 2022 13:58
@nobuyo nobuyo closed this Apr 19, 2022
@nobuyo nobuyo deleted the add-new-option-for-multiline-method-call-indentation branch April 19, 2022 13:59
@nobuyo
Copy link
Contributor Author

nobuyo commented Apr 19, 2022

Sorry, I had to rename branch and tried to keep PR and conversations by GitHub's branch rename function, but it closed PR automatically. I created a PR on the new branch. #10550

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

Successfully merging this pull request may close these issues.

Layout/MultilineMethodCallIndentation requesting illogical results
2 participants