rubocop-packs 0.0.33 → 0.0.35
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 +4 -4
- data/config/default.yml +6 -1
- data/lib/rubocop/cop/packs/documented_public_apis.rb +14 -3
- data/lib/rubocop/packs.rb +0 -1
- metadata +2 -3
- data/config/pack_config.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70a81aaeac4498d122b9386a684f03850bf3493f16d8214d72d9b49a8e3d6b66
|
4
|
+
data.tar.gz: 4a620b25ea514911cb80a74ff7b6c1afccc6d5145c3da11422bb3d1f97bdd8f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b31d9f3dd7706aee30acd3bc13127bacc8fad829cf7216cc58fd48b5c2443ae4c582d13de8508f17304dfde885f58c01693c3d5b5861df4419fbd574889e2ab
|
7
|
+
data.tar.gz: b696f3b449ddc0fa0300104fdc7fd9402a7c8a7db2d43d282b56a3aaa31d5c41569a0917e7e93d39188a88e068b1ae3cdd4bca45eac5a6feee1d542331cad211
|
data/config/default.yml
CHANGED
@@ -29,4 +29,9 @@ PackwerkLite/Dependency:
|
|
29
29
|
Enabled: false
|
30
30
|
|
31
31
|
# We do this inherit *after* setting the defaults so that pack-specific rubocops can override the defaults
|
32
|
-
|
32
|
+
# Relevant documentation:
|
33
|
+
# - Inheriting config from a gem:
|
34
|
+
# - https://docs.rubocop.org/rubocop/configuration.html#inheriting-configuration-from-a-dependency-gem
|
35
|
+
# - ERB in a .rubocop.yml file
|
36
|
+
# - https://docs.rubocop.org/rubocop/configuration.html#pre-processing
|
37
|
+
<%= RuboCop::Packs.pack_based_rubocop_config %>
|
@@ -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
|
data/lib/rubocop/packs.rb
CHANGED
@@ -17,7 +17,6 @@ module RuboCop
|
|
17
17
|
|
18
18
|
PROJECT_ROOT = T.let(Pathname.new(__dir__).parent.parent.expand_path.freeze, Pathname)
|
19
19
|
CONFIG_DEFAULT = T.let(PROJECT_ROOT.join('config', 'default.yml').freeze, Pathname)
|
20
|
-
CONFIG = T.let(YAML.safe_load(CONFIG_DEFAULT.read).freeze, T.untyped)
|
21
20
|
|
22
21
|
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
|
23
22
|
|
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.35
|
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-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -201,7 +201,6 @@ extra_rdoc_files: []
|
|
201
201
|
files:
|
202
202
|
- README.md
|
203
203
|
- config/default.yml
|
204
|
-
- config/pack_config.yml
|
205
204
|
- lib/rubocop-packs.rb
|
206
205
|
- lib/rubocop/cop/packs/class_methods_as_public_apis.rb
|
207
206
|
- lib/rubocop/cop/packs/documented_public_apis.rb
|
data/config/pack_config.yml
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
# Relevant documentation:
|
2
|
-
# - Inheriting config from a gem:
|
3
|
-
# - https://docs.rubocop.org/rubocop/configuration.html#inheriting-configuration-from-a-dependency-gem
|
4
|
-
# - ERB in a .rubocop.yml file
|
5
|
-
# - https://docs.rubocop.org/rubocop/configuration.html#pre-processing
|
6
|
-
<%= RuboCop::Packs.pack_based_rubocop_config %>
|