salsify_rubocop 0.47.1 → 0.47.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/rubocop/cop/salsify/style_dig.rb +5 -1
- data/lib/salsify_rubocop/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01ddf57339e753b601e0bbbefda0a87141ee09c5
|
4
|
+
data.tar.gz: 964f0c25cd592a0ca6a9949f3a4c05fa3d4630f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b5a9ed9d733e36708b4a75d14c6c82121f18eeb71fb16b542d9a8c1719a0a0580f61df67c5b793e240ab515ac4963f9adc3a90511d21e3ac3f737afb330cbec
|
7
|
+
data.tar.gz: bc07f258e1f8fc671f8f0ed2e763dc072a35bbfc300821e2585d9ee7ab631dd606af31e9dc823de9de4468651708eb2b49b087fabd9ba9828f542d45a6ada720
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# salsify_rubocop
|
2
2
|
|
3
|
+
## v0.47.2
|
4
|
+
- Fix issue for `Salsify/Style` with nested access as the target for
|
5
|
+
conditional assignment.
|
6
|
+
|
3
7
|
## v0.47.1
|
4
8
|
- Add `Salsify/StyleDig` cop to recommend using `#dig` for deeply nested access.
|
5
9
|
- Add `Salsify/RailsApplicationRecord` cop.
|
@@ -28,7 +28,7 @@ module RuboCop
|
|
28
28
|
PATTERN
|
29
29
|
|
30
30
|
def on_send(node)
|
31
|
-
nested_access_match(node)
|
31
|
+
if nested_access_match(node) && !conditional_assignment?(node)
|
32
32
|
match_node = node
|
33
33
|
# walk to outermost access node
|
34
34
|
match_node = match_node.parent while access_node?(match_node.parent)
|
@@ -55,6 +55,10 @@ module RuboCop
|
|
55
55
|
|
56
56
|
private
|
57
57
|
|
58
|
+
def conditional_assignment?(node)
|
59
|
+
node.parent && node.parent.or_asgn_type? && (node.parent.children.first == node)
|
60
|
+
end
|
61
|
+
|
58
62
|
def access_node?(node)
|
59
63
|
node && node.send_type? && node.method_name == :[]
|
60
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: salsify_rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.47.
|
4
|
+
version: 0.47.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salsify, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|