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 EmptyMetadata for splat kwargs #2005

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Conversation

pirj
Copy link
Member

@pirj pirj commented Dec 11, 2024

Fixes #2004, when metadata is detected as empty when it's actually a kwargs splat.

cc @tylerhunt


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • [-] Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@pirj pirj self-assigned this Dec 11, 2024
@pirj pirj requested a review from a team as a code owner December 11, 2024 21:04
@@ -21,6 +21,7 @@ class EmptyMetadata < Base

def on_metadata(_symbols, hash)
return unless hash&.pairs&.empty?
return if hash.children.any?(&:kwsplat_type?)
Copy link
Member Author

Choose a reason for hiding this comment

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

@tylerhunt
Copy link

Thanks, @pirj!

@pirj pirj force-pushed the fix-empty-metadata-for-kwargs-splat branch from 379b9fb to c78cda4 Compare December 11, 2024 21:07
@pirj pirj force-pushed the fix-empty-metadata-for-kwargs-splat branch from c78cda4 to 4832625 Compare December 11, 2024 21:09
@pirj pirj merged commit b8a0eb1 into master Dec 11, 2024
25 checks passed
@pirj pirj deleted the fix-empty-metadata-for-kwargs-splat branch December 11, 2024 22:26
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.

RSpec/EmptyMetadata false positive with double splat
3 participants