rubocop-rspec 3.0.4 → 3.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 169d3c16af254654f25f5b2d91abbee972be45feaa9b9103c54c00ce6592e41f
4
- data.tar.gz: 140cfd9fe9b060eaaf697aa3eb7e94667ea089635cf2910047c1c63c90c55d76
3
+ metadata.gz: 6ce22630f88fd7a9b996711a4af330a186471fdc8a6dd99b05830ad695a09118
4
+ data.tar.gz: 44a91f15e435ec623b2a25ae6e7b890772d7cf3066206f97b0ca1abf42c62c7a
5
5
  SHA512:
6
- metadata.gz: ecb48dd3947d2e830c205bf170ba47a9d81bafa685ecfafcbfbd23baa7dc9bee1cdb0002d9de44f8fd3fd3f9249187c4764676259f465f5bb2d0b9b5b3ea38f9
7
- data.tar.gz: 4d63767133ef37bebba948f952b120cb4ef95b891ecbfca78cf0450f9df8e0f712a10a272eb7e6b477869d0c50323926b9791f7afdc8c64df18f8ba03e2f5359
6
+ metadata.gz: 0d6b6f4113c4fc5253dcd59525e348879ae5763d09bb416de752d037b3ee20c38774df54322a8c7abd4c21652b22e6c4ac708bce51a2f1df61fecb4aab9dc4ac
7
+ data.tar.gz: ec0278b64e0dc0ca9cf0e9558ae02224ea5a3360ee86380336b4bc07e134801e46011f5ef673586eac6b85557884b3d3986d05935b3255ba48c227ecd760227c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Master (Unreleased)
4
4
 
5
+ ## 3.0.5 (2024-09-07)
6
+
7
+ - Fix false-negative and error for `RSpec/MetadataStyle` when non-literal args are used in metadata in `EnforceStyle: hash`. ([@cbliard])
8
+ - Improve offense message for `RSpec/IndexedLet`. ([@earlopain])
9
+
5
10
  ## 3.0.4 (2024-08-05)
6
11
 
7
12
  - Fix false-negative for `UnspecifiedException` when matcher is chained. ([@r7kamura])
@@ -911,6 +916,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
911
916
  [@bquorning]: https://github.com/bquorning
912
917
  [@brentwheeldon]: https://github.com/BrentWheeldon
913
918
  [@brianhawley]: https://github.com/BrianHawley
919
+ [@cbliard]: https://github.com/cbliard
914
920
  [@cfabianski]: https://github.com/cfabianski
915
921
  [@clupprich]: https://github.com/clupprich
916
922
  [@composerinteralia]: https://github.com/composerinteralia
@@ -48,8 +48,8 @@ module RuboCop
48
48
  include AllowedIdentifiers
49
49
  include AllowedPattern
50
50
 
51
- MSG = 'This `let` statement uses index in its name. Please give it ' \
52
- 'a meaningful name.'
51
+ MSG = 'This `let` statement uses `%<index>s` in its name. ' \
52
+ 'Please give it a meaningful name.'
53
53
 
54
54
  # @!method let_name(node)
55
55
  def_node_matcher :let_name, <<~PATTERN
@@ -66,7 +66,8 @@ module RuboCop
66
66
  return unless children
67
67
 
68
68
  filter_indexed_lets(children).each do |let_node|
69
- add_offense(let_node)
69
+ index = let_name(let_node)[INDEX_REGEX]
70
+ add_offense(let_node, message: format(MSG, index: index))
70
71
  end
71
72
  end
72
73
 
@@ -45,13 +45,8 @@ module RuboCop
45
45
  PATTERN
46
46
 
47
47
  def on_metadata(symbols, hash)
48
- # RSpec example groups accept two string arguments. In such a case,
49
- # the rspec_metadata matcher will interpret the second string
50
- # argument as a metadata symbol.
51
- symbols.shift if symbols.first&.str_type?
52
-
53
48
  symbols.each do |symbol|
54
- on_metadata_symbol(symbol)
49
+ on_metadata_symbol(symbol) if symbol.sym_type?
55
50
  end
56
51
 
57
52
  return unless hash
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module RSpec
5
5
  # Version information for the RSpec RuboCop plugin.
6
6
  module Version
7
- STRING = '3.0.4'
7
+ STRING = '3.0.5'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Backus
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-08-05 00:00:00.000000000 Z
13
+ date: 2024-09-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  requirements: []
210
- rubygems_version: 3.5.11
210
+ rubygems_version: 3.5.16
211
211
  signing_key:
212
212
  specification_version: 4
213
213
  summary: Code style checking for RSpec files