Fix offenses for InternalAffairs/NodePatternGroups cop#2114
Merged
Conversation
Collaborator
|
We need |
bquorning
reviewed
Oct 2, 2025
| @@ -69,7 +69,7 @@ def string?(node) | |||
| end | |||
|
|
|||
| def symbol?(node) | |||
Collaborator
There was a problem hiding this comment.
Maybe we should inline #string? and #symbol? now? They are only used once each.
bquorning
approved these changes
Oct 2, 2025
This cop was added by the following PR. - rubocop/rubocop#13762 ``` Offenses: lib/rubocop/cop/rspec/context_wording.rb:70:63: C: [Corrected] InternalAffairs/NodePatternGroups: Replace str, dstr, xstr in node pattern union with any_str. (block (send #rspec? { :context :shared_context } $({str dstr xstr} ...) ...) ...) ^^^^^^^^^^^^^^^ lib/rubocop/cop/rspec/mixin/final_end_location.rb:10:34: C: [Corrected] InternalAffairs/NodeTypeGroup: Use :any_str instead of individually listing group types. start_node.each_node(:str, :dstr, :xstr) ^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/rspec/mixin/variable.rb:16:15: C: [Corrected] InternalAffairs/NodePatternGroups: Replace sym, dsym in node pattern union with any_sym. $({sym str dsym dstr} ...) ...) ^^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/rspec/predicate_matcher.rb:184:36: C: [Corrected] Style/SymbolProc: Pass &:any_str_type? as an argument to select instead of a block. matcher.arguments.select do |arg| ... ^^^^^^^^ lib/rubocop/cop/rspec/predicate_matcher.rb:185:23: C: [Corrected] InternalAffairs/NodeTypeGroup: Use :any_str instead of individually listing group types. arg.type?(:str, :dstr, :xstr) ^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/rspec/sort_metadata.rb:33:28: C: [Corrected] InternalAffairs/NodePatternGroups: Replace str, dstr, xstr in node pattern union with any_str. (send _ _ _ ... !{hash sym str dstr xstr}) ^^^^^^^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/rspec/variable_definition.rb:72:22: C: [Corrected] InternalAffairs/NodeTypeGroup: Use :any_sym instead of individually listing group types. node.type?(:sym, :dsym) ^^^^^^^^^^^ 282 files inspected, 7 offenses detected, 7 offenses corrected ```
ydah
commented
Oct 2, 2025
| ## Master (Unreleased) | ||
|
|
||
| - Add new cop `RSpec/LeakyLocalVariable`. ([@lovro-bikic]) | ||
| - Bump RuboCop requirement to +1.81. ([@ydah]) |
bquorning
approved these changes
Oct 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix offenses for InternalAffairs/NodePatternGroups cop
This cop was added by the following PR.
InternalAffairs/NodePatternGroupscop rubocop#13762Before submitting the PR make sure the following are checked:
master(if not - rebase it).CHANGELOG.mdif the new code introduces user-observable changes.bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).