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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/rubocop/cop/rspec/indexed_let.rb +4 -3
- data/lib/rubocop/cop/rspec/metadata_style.rb +1 -6
- data/lib/rubocop/rspec/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ce22630f88fd7a9b996711a4af330a186471fdc8a6dd99b05830ad695a09118
|
4
|
+
data.tar.gz: 44a91f15e435ec623b2a25ae6e7b890772d7cf3066206f97b0ca1abf42c62c7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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
|
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
|
+
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-
|
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.
|
210
|
+
rubygems_version: 3.5.16
|
211
211
|
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: Code style checking for RSpec files
|