KEMBAR78
[Fix #14441] Better hash access handling in `Style/SafeNavigation` by issyl0 · Pull Request #14450 · rubocop/rubocop · GitHub
Skip to content

Conversation

@issyl0
Copy link
Contributor

@issyl0 issyl0 commented Aug 15, 2025


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.

…ion`

- Make the `matching_call_nodes?` method account for differences in
  arguments.
- Code like `foo[:bar] && foo[:baz].blank?` does not need safe
  navigation because the hash keys are different.
@issyl0 issyl0 force-pushed the fix-14441-safe-navigation-with-hash-access branch from b43b25e to 7a08e3d Compare August 17, 2025 22:15
@koic koic merged commit 5673b8c into rubocop:master Aug 17, 2025
23 checks passed
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.

Style/SafeNavigation cop gives incorrect results after #14424

2 participants