rubocop-packs 0.0.33 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubocop/cop/packs/documented_public_apis.rb +14 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa1524fd9d2f94de215b45b9b2a26bd0984286d21e59c787caf70717d1ebb3ae
|
4
|
+
data.tar.gz: b749545874b549013197564cccce90f58cdafb838b38e9045e1cbcd53f325d97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 054c01a73226e1cae5bbc96f17f3757156aeeb4980745d46cac49a9661b67e29b4fd802e4b83668ad5468122fe6c351e81b06db90b44ac98c3e3705efe1d7dbb
|
7
|
+
data.tar.gz: df0a6e1355e1d455c03c5fd3b067ca7bb97d14f86bf94829d1909aa6e4d03812ddd743291cd93b35261147f0adc29ebffafa6efc10d4380df8f7301a8fc0aad3
|
@@ -54,9 +54,14 @@ module RuboCop
|
|
54
54
|
return if non_public?(node) && !require_for_non_public_methods?
|
55
55
|
|
56
56
|
left_sibling = node.left_sibling
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
|
58
|
+
if left_sibling == :private_class_method
|
59
|
+
if node_is_sorbet_signature?(node.parent.left_sibling)
|
60
|
+
return if documentation_comment?(node.parent.left_sibling)
|
61
|
+
elsif documentation_comment?(node.parent)
|
62
|
+
return
|
63
|
+
end
|
64
|
+
elsif node_is_sorbet_signature?(left_sibling)
|
60
65
|
return if documentation_comment?(node.left_sibling)
|
61
66
|
elsif documentation_comment?(node)
|
62
67
|
return
|
@@ -64,6 +69,12 @@ module RuboCop
|
|
64
69
|
|
65
70
|
add_offense(node)
|
66
71
|
end
|
72
|
+
|
73
|
+
sig { params(node: T.untyped).returns(T::Boolean) }
|
74
|
+
def node_is_sorbet_signature?(node)
|
75
|
+
# Is there a better way to check if a node is a sorbet signature? Probably!
|
76
|
+
!!(node && (node.source.include?('sig do') || node.source.include?('sig {')))
|
77
|
+
end
|
67
78
|
end
|
68
79
|
end
|
69
80
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-packs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|