rubocop-teamtailor 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3415d0a918da6562c673c1113f17a517e8841834a7005efddd48931d2b7245d
|
4
|
+
data.tar.gz: c3cd2927bc900eef6a7e55c6e96ff90087c7473ac2ce22b4ce6091ce3ca55abd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3252311d281326157c2e70dce4ddf9cd7677baf442df466e4cde62e26784a632bcc7696fabd9bd279b743f1197f6823a0060af6d3acb9bab422408845a3454a
|
7
|
+
data.tar.gz: e7b64854a74e7ef40b9fe1e03c8ae9e9f732d55c942b55ad640b29f429cb62c5d4eb2d14237c6595d03f523229b4c0c40a05324edf96710d04967935e24e59ce
|
@@ -10,6 +10,10 @@ module RuboCop
|
|
10
10
|
(send nil? {:has_many | :has_one} ...)
|
11
11
|
PATTERN
|
12
12
|
|
13
|
+
def_node_matcher :no_embed?, <<~PATTERN
|
14
|
+
(sym {:embed | :embed_in_root})
|
15
|
+
PATTERN
|
16
|
+
|
13
17
|
def on_class(class_node)
|
14
18
|
return unless class_node.defined_module_name.end_with?("Serializer")
|
15
19
|
check_children(class_node)
|
@@ -17,8 +21,17 @@ module RuboCop
|
|
17
21
|
|
18
22
|
private
|
19
23
|
|
24
|
+
def is_embedding?(node)
|
25
|
+
return true if no_embed?(node)
|
26
|
+
|
27
|
+
if node.respond_to?(:children)
|
28
|
+
return node.children.any? { |child| is_embedding?(child) }
|
29
|
+
end
|
30
|
+
false
|
31
|
+
end
|
32
|
+
|
20
33
|
def check_children(node)
|
21
|
-
if no_has_many?(node)
|
34
|
+
if no_has_many?(node) && is_embedding?(node)
|
22
35
|
add_offense(node)
|
23
36
|
end
|
24
37
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-teamtailor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Brusman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
|
-
rubygems_version: 3.
|
72
|
+
rubygems_version: 3.5.22
|
73
73
|
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Teamtailor's RuboCop cops
|