Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
Make the RubocopProtectionInterface simpler to support easier rubocop…
Browse files Browse the repository at this point in the history
… based package protections (#10)

* By default, a protection has no unmet preconditions

* add cop name to the interface

* move get_offenses_for_existing_violations into interface, fix tests

* remove cop name constant

* remove root package restriction

* add back custom message for fail on any

* move cop configs to rubocop interface

* organize code into abstract vs overiddable

* bump version

* move namespace package protection interface into cop

* move typed api protection interface into cop

* rubocop

* tc
  • Loading branch information
Alex Evanczuk authored Jun 30, 2022
1 parent 0c312f7 commit 0280038
Show file tree
Hide file tree
Showing 10 changed files with 238 additions and 265 deletions.
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
package_protections (1.0.0)
package_protections (1.1.0)
activesupport
parse_packwerk
rubocop
Expand All @@ -23,9 +23,9 @@ GEM
i18n (1.10.0)
concurrent-ruby (~> 1.0)
method_source (1.0.0)
minitest (5.15.0)
minitest (5.16.1)
parallel (1.21.0)
parse_packwerk (0.10.0)
parse_packwerk (0.10.1)
sorbet-runtime
parser (3.1.0.0)
ast (~> 2.4.1)
Expand Down Expand Up @@ -67,7 +67,7 @@ GEM
parser (>= 3.0.1.1)
rubocop-rspec (2.8.0)
rubocop (~> 1.19)
rubocop-sorbet (0.6.8)
rubocop-sorbet (0.6.10)
rubocop (>= 0.90.0)
ruby-progressbar (1.11.0)
sorbet (0.5.9588)
Expand Down
2 changes: 0 additions & 2 deletions lib/package_protections/private.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

require 'package_protections/private/colorized_string'
require 'package_protections/private/output'
require 'package_protections/private/typed_api_protection'
require 'package_protections/private/incoming_privacy_protection'
require 'package_protections/private/outgoing_dependency_protection'
require 'package_protections/private/metadata_modifiers'
require 'package_protections/private/multiple_namespaces_protection'
require 'package_protections/private/visibility_protection'
require 'package_protections/private/configuration'

Expand Down
4 changes: 2 additions & 2 deletions lib/package_protections/private/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def default_protections
[
Private::OutgoingDependencyProtection.new,
Private::IncomingPrivacyProtection.new,
Private::TypedApiProtection.new,
Private::MultipleNamespacesProtection.new,
RuboCop::Cop::PackageProtections::TypedPublicApi.new,
RuboCop::Cop::PackageProtections::NamespacedUnderPackageName.new,
Private::VisibilityProtection.new
]
end
Expand Down
128 changes: 0 additions & 128 deletions lib/package_protections/private/multiple_namespaces_protection.rb

This file was deleted.

106 changes: 0 additions & 106 deletions lib/package_protections/private/typed_api_protection.rb

This file was deleted.

Loading

0 comments on commit 0280038

Please sign in to comment.