rubocop-packs 0.0.17 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/config/default.yml +7 -3
- data/lib/rubocop/cop/packs/class_methods_as_public_apis.rb +1 -1
- data/lib/rubocop/cop/packs/{require_documented_public_apis.rb → documented_public_apis.rb} +1 -1
- data/lib/rubocop/cop/packs/{namespace_convention → root_namespace_is_pack_name}/desired_zeitwerk_api.rb +1 -1
- data/lib/rubocop/cop/packs/{namespace_convention.rb → root_namespace_is_pack_name.rb} +2 -2
- data/lib/rubocop/cop/packs/{typed_public_api.rb → typed_public_apis.rb} +1 -1
- data/lib/rubocop-packs.rb +3 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f2f8bb6cbf9a0c8e6a903a9e94ecbc6b31b25f38caadee98b9d433ce0ea9d83
|
4
|
+
data.tar.gz: '0843185e5171470039bf39ff147fcf8f5fc93269b11c955c1358891c6df6e95f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea2a62a6152a629acef1a17cf95b7833573aad7e838adbd969820490683f8ad710ce06544e54e913b231f2426ee75a2f4fe331fac37f246ebb20fb21ae5263d9
|
7
|
+
data.tar.gz: 5ee607be5da8cbe0d0d416c46f0ffe983d14dbdc8effc4e1551b0aa33a6d0a323f9a5e8fefb59a12ebc1acaab31d37f98e4e59141b06a85bf486f82c0f8d2fb3
|
data/README.md
CHANGED
@@ -36,7 +36,7 @@ All cops are located under [`lib/rubocop/cop/packs`](lib/rubocop/cop/packs), and
|
|
36
36
|
In your `.rubocop.yml`, you may treat the Packs cops just like any other cop. For example:
|
37
37
|
|
38
38
|
```yaml
|
39
|
-
Packs/
|
39
|
+
Packs/RootNamespaceIsPackName:
|
40
40
|
Exclude:
|
41
41
|
- lib/example.rb
|
42
42
|
```
|
@@ -70,8 +70,8 @@ To use per-pack `.rubocop.yml` and `.rubocop_todo.yml` files, you need to config
|
|
70
70
|
```ruby
|
71
71
|
# config/rubocop_packs.rb
|
72
72
|
RuboCop::Packs.configure do |config|
|
73
|
-
config.permitted_pack_level_cops = ['Packs/
|
74
|
-
config.required_pack_level_cops = ['Packs/
|
73
|
+
config.permitted_pack_level_cops = ['Packs/RootNamespaceIsPackName']
|
74
|
+
config.required_pack_level_cops = ['Packs/RootNamespaceIsPackName']
|
75
75
|
end
|
76
76
|
```
|
77
77
|
|
data/config/default.yml
CHANGED
@@ -7,15 +7,19 @@ Packs/ClassMethodsAsPublicApis:
|
|
7
7
|
- T::Struct
|
8
8
|
- Struct
|
9
9
|
- OpenStruct
|
10
|
+
FailureMode: default
|
10
11
|
|
11
|
-
Packs/
|
12
|
+
Packs/RootNamespaceIsPackName:
|
12
13
|
Enabled: true
|
14
|
+
FailureMode: default
|
13
15
|
|
14
|
-
Packs/
|
16
|
+
Packs/TypedPublicApis:
|
15
17
|
Enabled: true
|
18
|
+
FailureMode: default
|
16
19
|
|
17
|
-
Packs/
|
20
|
+
Packs/DocumentedPublicApis:
|
18
21
|
Enabled: true
|
22
|
+
FailureMode: default
|
19
23
|
|
20
24
|
PackwerkLite/Privacy:
|
21
25
|
# It is recommended to use packwerk
|
@@ -21,7 +21,7 @@ module RuboCop
|
|
21
21
|
# def bar; end
|
22
22
|
# end
|
23
23
|
#
|
24
|
-
class
|
24
|
+
class DocumentedPublicApis < Style::DocumentationMethod
|
25
25
|
# This cop does two things:
|
26
26
|
# 1) It only activates for things in the public folder
|
27
27
|
# 2) It allows `Style/DocumentationMethod` to work with sigs as expected.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module RuboCop
|
4
4
|
module Cop
|
5
5
|
module Packs
|
6
|
-
class
|
6
|
+
class RootNamespaceIsPackName < Base
|
7
7
|
#
|
8
8
|
# This is a private class that represents API that we would prefer to be available somehow in Zeitwerk.
|
9
9
|
# However, the boundaries between systems (packwerk/zeitwerk, rubocop/zeitwerk) are poor in this class, so
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# For String#camelize
|
4
4
|
require 'active_support/core_ext/string/inflections'
|
5
|
-
require 'rubocop/cop/packs/
|
5
|
+
require 'rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api'
|
6
6
|
|
7
7
|
module RuboCop
|
8
8
|
module Cop
|
@@ -23,7 +23,7 @@ module RuboCop
|
|
23
23
|
# # packs/foo/app/services/foo/blah/bar.rb
|
24
24
|
# class Foo::Blah::Bar; end
|
25
25
|
#
|
26
|
-
class
|
26
|
+
class RootNamespaceIsPackName < Base
|
27
27
|
extend T::Sig
|
28
28
|
|
29
29
|
include RangeHelp
|
@@ -19,7 +19,7 @@ module RuboCop
|
|
19
19
|
# # typed: strict
|
20
20
|
# module Foo; end
|
21
21
|
#
|
22
|
-
class
|
22
|
+
class TypedPublicApis < Sorbet::StrictSigil
|
23
23
|
#
|
24
24
|
# This inherits from `Sorbet::StrictSigil` and doesn't change any behavior of it.
|
25
25
|
# The only reason we do this is so that configuration for this cop can live under a different cop namespace.
|
data/lib/rubocop-packs.rb
CHANGED
@@ -8,9 +8,9 @@ require_relative 'rubocop/packs'
|
|
8
8
|
require_relative 'rubocop/packs/inject'
|
9
9
|
require_relative 'rubocop/packwerk_lite'
|
10
10
|
|
11
|
-
require 'rubocop/cop/packs/
|
12
|
-
require 'rubocop/cop/packs/
|
11
|
+
require 'rubocop/cop/packs/root_namespace_is_pack_name'
|
12
|
+
require 'rubocop/cop/packs/typed_public_apis'
|
13
13
|
require 'rubocop/cop/packs/class_methods_as_public_apis'
|
14
|
-
require 'rubocop/cop/packs/
|
14
|
+
require 'rubocop/cop/packs/documented_public_apis'
|
15
15
|
|
16
16
|
RuboCop::Packs::Inject.defaults!
|
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.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -190,10 +190,10 @@ files:
|
|
190
190
|
- config/pack_config.yml
|
191
191
|
- lib/rubocop-packs.rb
|
192
192
|
- lib/rubocop/cop/packs/class_methods_as_public_apis.rb
|
193
|
-
- lib/rubocop/cop/packs/
|
194
|
-
- lib/rubocop/cop/packs/
|
195
|
-
- lib/rubocop/cop/packs/
|
196
|
-
- lib/rubocop/cop/packs/
|
193
|
+
- lib/rubocop/cop/packs/documented_public_apis.rb
|
194
|
+
- lib/rubocop/cop/packs/root_namespace_is_pack_name.rb
|
195
|
+
- lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb
|
196
|
+
- lib/rubocop/cop/packs/typed_public_apis.rb
|
197
197
|
- lib/rubocop/cop/packwerk_lite/constant_resolver.rb
|
198
198
|
- lib/rubocop/cop/packwerk_lite/dependency_checker.rb
|
199
199
|
- lib/rubocop/cop/packwerk_lite/privacy_checker.rb
|