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

Add new Layout/MultilineMethodParameterLineBreaks cop #10691

Merged

Conversation

Korri
Copy link
Contributor

@Korri Korri commented Jun 3, 2022

Introduce new Layout/MultilineMethodParameterLineBreaks cop, based closely on the MultilineMethodArgumentLineBreaks cop.

# bad
def(foo, bar,
  buz)
  do_something
end

# good
def (foo,
  bar,
  buz)
  do_something
end

This was split from the larger WIP pull request here: #10681


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.

@Korri Korri changed the title Layout/multiline method parameter line breaks MultilineMethodParameterLineBreaks cop & autocorrect Jun 3, 2022
@Korri Korri force-pushed the Layout/MultilineMethodParameterLineBreaks branch from 38fb8dd to 43642a2 Compare June 3, 2022 21:06
@Korri Korri changed the title MultilineMethodParameterLineBreaks cop & autocorrect Add new MultilineMethodParameterLineBreaks cop Jun 3, 2022
@Korri Korri changed the title Add new MultilineMethodParameterLineBreaks cop Add new Layout/MultilineMethodParameterLineBreaks cop Jun 3, 2022
@Korri Korri force-pushed the Layout/MultilineMethodParameterLineBreaks branch from 43642a2 to 5cd1bee Compare June 3, 2022 21:09
@Korri Korri marked this pull request as ready for review June 3, 2022 21:11
config/default.yml Outdated Show resolved Hide resolved
@Korri Korri force-pushed the Layout/MultilineMethodParameterLineBreaks branch from 5cd1bee to 0313506 Compare June 6, 2022 14:59
Same as MultilineMethodArgumentLineBreaks but for method definitions,
this completes the set of cops that already existed for method calls,
array definitions, and Hash definitions.
@Korri Korri force-pushed the Layout/MultilineMethodParameterLineBreaks branch from 0313506 to 2f86449 Compare July 4, 2022 20:51
@Korri Korri requested a review from bbatsov July 5, 2022 13:41
@bbatsov bbatsov merged commit 87a0497 into rubocop:master Jul 9, 2022
@bbatsov
Copy link
Collaborator

bbatsov commented Jul 9, 2022

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

Successfully merging this pull request may close these issues.

None yet

3 participants