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 false negative for Layout/SpaceAroundBlockParameters #6797

Merged

Conversation

pocke
Copy link
Collaborator

@pocke pocke commented Mar 1, 2019

The cop is not aware of parens in block parameter. This pull request fixes this problem.

Example

{}.each { |x, (x,  y)| nothing}
#                ^ The cop should detect this space, but acutally it does not.

Before submitting the PR make sure the following are checked:

  • 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.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

@pocke pocke force-pushed the fix-for-Layout/SpaceAroundBlockParameters branch from d372514 to cee94d9 Compare March 1, 2019 14:05
@pocke pocke added the bug label Mar 1, 2019
CHANGELOG.md Outdated
@@ -5,6 +5,7 @@
### Bug fixes

* [#6699](https://github.com/rubocop-hq/rubocop/issues/6699): Fix infinite loop for `Layout/IndentationWidth` and `Layout/IndentationConsistency` when bad modifier indentation before good method definition. ([@koic][])
* [#6797](https://github.com/rubocop-hq/rubocop/pull/6797): Fix false negative for Layout/SpaceAroundBlockParameters. ([@pocke][])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain in more detail about the false negative corrected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure 👍 I'll update it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the description of the changelog. Thanks!

@pocke pocke force-pushed the fix-for-Layout/SpaceAroundBlockParameters branch from cee94d9 to 67791d7 Compare March 2, 2019 12:58
@pocke pocke force-pushed the fix-for-Layout/SpaceAroundBlockParameters branch from 67791d7 to 9612547 Compare March 2, 2019 13:23
@pocke pocke merged commit fa6f71c into rubocop:master Mar 2, 2019
@pocke pocke deleted the fix-for-Layout/SpaceAroundBlockParameters branch March 2, 2019 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants