rubocop-packs 0.0.17 → 0.0.18

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: 36151891d908f1db1ea404ec0890094a874ad30cd49bafe4ba6be84cc07f3234
4
- data.tar.gz: d9cd4893c8bc730407e7cc777947a03b0f52290ea11c98d84f74cbafbbb23d41
3
+ metadata.gz: ad176fde4b980a18810e2563daf9c097bf4569d83a713e7d0efab4a7118e32c8
4
+ data.tar.gz: cd71dc7323afd1bf9c4dea9818cc6e177cacce44e94337c0746c6db01bb69a1b
5
5
  SHA512:
6
- metadata.gz: 9949c24590b6afe33471b75e71319ff6070e1b1040cb62652299f31af2fb9381603250e20e182b7ef0fdacd016e82282aea6c779e5ee242e17a23eac9a8e2459
7
- data.tar.gz: ba7cf7c051c6f4e0306e8215e6e3d8cb33f9fb4095ce0634ddb79297a57cc9963323f74b1f69b88a74560f67dfe8342a27fde53d819b46e665a238c011bc6175
6
+ metadata.gz: b19478228beb486ac967de7479048a6f01ffd0ba2cb608ce9a5e6c5ad6966f2431fb5df38636cdc079e7e89e8e574ddd126f5be28d307209430b9e3389596ec5
7
+ data.tar.gz: a5b7ea366640f39b2631b02d2d8fe59997c1449e57e6b9c3f7da7a58acc4fe471627c9bdf55734ef085e4b6de5bd562979833793e121a4532c3c52fee29d0b18
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/NamespaceConvention:
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/NamespaceConvention']
74
- config.required_pack_level_cops = ['Packs/NamespaceConvention']
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
@@ -8,13 +8,13 @@ Packs/ClassMethodsAsPublicApis:
8
8
  - Struct
9
9
  - OpenStruct
10
10
 
11
- Packs/NamespaceConvention:
11
+ Packs/RootNamespaceIsPackName:
12
12
  Enabled: true
13
13
 
14
- Packs/TypedPublicApi:
14
+ Packs/TypedPublicApis:
15
15
  Enabled: true
16
16
 
17
- Packs/RequireDocumentedPublicApis:
17
+ Packs/DocumentedPublicApis:
18
18
  Enabled: true
19
19
 
20
20
  PackwerkLite/Privacy:
@@ -55,7 +55,7 @@ module RuboCop
55
55
  add_offense(
56
56
  node.source_range,
57
57
  message: format(
58
- 'Top-level files in the public/ folder may only define class methods.'
58
+ "Public API method must be a class method (e.g. `self.#{node.method_name}(...)`)"
59
59
  )
60
60
  )
61
61
  end
@@ -21,7 +21,7 @@ module RuboCop
21
21
  # def bar; end
22
22
  # end
23
23
  #
24
- class RequireDocumentedPublicApis < Style::DocumentationMethod
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 NamespaceConvention < Base
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/namespace_convention/desired_zeitwerk_api'
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 NamespaceConvention < Base
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 TypedPublicApi < Sorbet::StrictSigil
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/namespace_convention'
12
- require 'rubocop/cop/packs/typed_public_api'
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/require_documented_public_apis'
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.17
4
+ version: 0.0.18
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-10 00:00:00.000000000 Z
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/namespace_convention.rb
194
- - lib/rubocop/cop/packs/namespace_convention/desired_zeitwerk_api.rb
195
- - lib/rubocop/cop/packs/require_documented_public_apis.rb
196
- - lib/rubocop/cop/packs/typed_public_api.rb
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