Skip to content

Commit 1872722

Browse files
authored
Merge pull request #2114 from rubocop/fix-offenses
Fix offenses for InternalAffairs/NodePatternGroups cop
2 parents 812bdfe + 36731f9 commit 1872722

File tree

8 files changed

+8
-9
lines changed

8 files changed

+8
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Master (Unreleased)
44

55
- Add new cop `RSpec/LeakyLocalVariable`. ([@lovro-bikic])
6+
- Bump RuboCop requirement to +1.81. ([@ydah])
67

78
## 3.7.0 (2025-09-01)
89

lib/rubocop/cop/rspec/context_wording.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class ContextWording < Base
6767

6868
# @!method context_wording(node)
6969
def_node_matcher :context_wording, <<~PATTERN
70-
(block (send #rspec? { :context :shared_context } $({str dstr xstr} ...) ...) ...)
70+
(block (send #rspec? { :context :shared_context } $(any_str ...) ...) ...)
7171
PATTERN
7272

7373
def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler

lib/rubocop/cop/rspec/mixin/final_end_location.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module RSpec
77
module FinalEndLocation
88
def final_end_location(start_node)
99
heredoc_endings =
10-
start_node.each_node(:str, :dstr, :xstr)
10+
start_node.each_node(:any_str)
1111
.select(&:heredoc?)
1212
.map { |node| node.loc.heredoc_end }
1313

lib/rubocop/cop/rspec/mixin/variable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Variable
1313
# @!method variable_definition?(node)
1414
def_node_matcher :variable_definition?, <<~PATTERN
1515
(send nil? {#Subjects.all #Helpers.all}
16-
$({sym str dsym dstr} ...) ...)
16+
$({any_sym str dstr} ...) ...)
1717
PATTERN
1818
end
1919
end

lib/rubocop/cop/rspec/predicate_matcher.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,7 @@ def uncorrectable_matcher?(node, matcher)
181181
end
182182

183183
def heredoc_argument?(matcher)
184-
matcher.arguments.select do |arg|
185-
arg.type?(:str, :dstr, :xstr)
186-
end.any?(&:heredoc?)
184+
matcher.arguments.select(&:any_str_type?).any?(&:heredoc?)
187185
end
188186

189187
# @!method predicate_matcher?(node)

lib/rubocop/cop/rspec/sort_metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SortMetadata < Base
3030

3131
# @!method match_ambiguous_trailing_metadata?(node)
3232
def_node_matcher :match_ambiguous_trailing_metadata?, <<~PATTERN
33-
(send _ _ _ ... !{hash sym str dstr xstr})
33+
(send _ _ _ ... !{hash sym any_str})
3434
PATTERN
3535

3636
def on_metadata(args, hash)

lib/rubocop/cop/rspec/variable_definition.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def string?(node)
6969
end
7070

7171
def symbol?(node)
72-
node.type?(:sym, :dsym)
72+
node.any_sym_type?
7373
end
7474
end
7575
end

rubocop-rspec.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ Gem::Specification.new do |spec|
3939
}
4040

4141
spec.add_dependency 'lint_roller', '~> 1.1'
42-
spec.add_dependency 'rubocop', '~> 1.72', '>= 1.72.1'
42+
spec.add_dependency 'rubocop', '~> 1.81'
4343
end

0 commit comments

Comments
 (0)