package_protections 2.0.0 → 2.1.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: 2e7bd9febdd0619b714c112033b8bf61958e04368e8fb0c0e5f3498de54e988c
4
- data.tar.gz: a0f7c5f79f3eb1279d084045c115345424dd2acfa22954eed321d2cf220bd40b
3
+ metadata.gz: 7471704e495c4ffe4e849be40a9fad64eed08e3980e9d630300eeae5c8e0d006
4
+ data.tar.gz: dbb34a83f3b4f7ed1a3327d36ac2dd5191d17bba0206ebfa06344d056c35b43a
5
5
  SHA512:
6
- metadata.gz: b8ff41de5e829270999baa91dc8df0fb3e810c6e8be39358cdbc6fd188a9d79ddf138f19b935a13360106c2a5e6c8300edffdf5fedf71e39c52826d2a6050a9e
7
- data.tar.gz: f255780ea5ed693e66edcd028b4b8247419c612afddd1790f53078ecec3ca274e456c6ed16e62a0d83158c853f2be25282250c5b40b93b069da504469d25acf8
6
+ metadata.gz: 77012017f0440763480a9f02ab289254870b9d937ff72cfa8f665331b04195cf01e1724562796d1a74414d38c855fa95710879d6efe105367792a3cf7b1bf60b
7
+ data.tar.gz: 48cb93ff9ec6b2b4785587c795fb6571ff55ade4de471c93b38fa3244113b4d4b0ecd6f431d335754ad4d5c6e7d23e3ec6701c71d0fca1328848dcf5a1f27836
@@ -35,6 +35,8 @@ module PackageProtections
35
35
 
36
36
  sig { returns(T::Array[ProtectionInterface]) }
37
37
  def default_protections
38
+ require 'rubocop/cop/package_protections'
39
+
38
40
  [
39
41
  Private::OutgoingDependencyProtection.new,
40
42
  Private::IncomingPrivacyProtection.new,
@@ -1,20 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # typed: strict
4
+
4
5
  require 'sorbet-runtime'
6
+
5
7
  require 'open3'
6
8
  require 'set'
7
9
  require 'parse_packwerk'
8
- require 'rubocop'
9
- require 'rubocop-sorbet'
10
10
 
11
- #
11
+ require 'zeitwerk'
12
+ loader = T.unsafe(Zeitwerk::Loader).for_gem
13
+ loader.ignore("#{__dir__}/rubocop")
14
+ loader.setup
15
+
12
16
  # Welcome to PackageProtections!
13
17
  # See https://github.com/rubyatscale/package_protections#readme for more info
14
18
  #
15
19
  # This file is a reference for the available API to `package_protections`, but all implementation details are private
16
20
  # (which is why we delegate to `Private` for the actual implementation).
17
- #
18
21
  module PackageProtections
19
22
  extend T::Sig
20
23
 
@@ -27,18 +30,6 @@ module PackageProtections
27
30
  # This is currently the only handled exception that `PackageProtections` will throw.
28
31
  class IncorrectPublicApiUsageError < StandardError; end
29
32
 
30
- require 'package_protections/offense'
31
- require 'package_protections/violation_behavior'
32
- require 'package_protections/protected_package'
33
- require 'package_protections/per_file_violation'
34
- require 'package_protections/protection_interface'
35
- require 'package_protections/rubocop_protection_interface'
36
- require 'package_protections/private'
37
-
38
- # Implementation of rubocop-based protections
39
- require 'rubocop/cop/package_protections/namespaced_under_package_name'
40
- require 'rubocop/cop/package_protections/typed_public_api'
41
-
42
33
  class << self
43
34
  extend T::Sig
44
35
 
@@ -128,3 +119,7 @@ module PackageProtections
128
119
  RubocopProtectionInterface.bust_rubocop_todo_yml_cache
129
120
  end
130
121
  end
122
+
123
+ if defined?(Rubocop)
124
+ require 'rubocop/cop/package_protections'
125
+ end
@@ -0,0 +1,13 @@
1
+ require 'rubocop'
2
+ require 'rubocop-sorbet'
3
+
4
+ module RuboCop
5
+ module Cop
6
+ module PackageProtections
7
+ autoload :NamespacedUnderPackageName, 'rubocop/cop/package_protections/namespaced_under_package_name'
8
+ autoload :TypedPublicApi, 'rubocop/cop/package_protections/typed_public_api'
9
+ end
10
+ end
11
+ end
12
+
13
+ # Implementation of rubocop-based protections
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: package_protections
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
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-09-12 00:00:00.000000000 Z
11
+ date: 2022-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: zeitwerk
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rake
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -191,6 +205,7 @@ files:
191
205
  - lib/package_protections/rspec/support.rb
192
206
  - lib/package_protections/rubocop_protection_interface.rb
193
207
  - lib/package_protections/violation_behavior.rb
208
+ - lib/rubocop/cop/package_protections.rb
194
209
  - lib/rubocop/cop/package_protections/namespaced_under_package_name.rb
195
210
  - lib/rubocop/cop/package_protections/namespaced_under_package_name/desired_zeitwerk_api.rb
196
211
  - lib/rubocop/cop/package_protections/typed_public_api.rb