diff --git a/Gemfile.lock b/Gemfile.lock index 62ecd0c..ace3457 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -34,14 +34,14 @@ GEM method_source (1.0.0) minitest (5.15.0) multi_json (1.15.0) - package_protections (0.64.0) + package_protections (1.4.0) activesupport parse_packwerk rubocop rubocop-sorbet sorbet-runtime parallel (1.22.1) - parse_packwerk (0.10.0) + parse_packwerk (0.12.0) sorbet-runtime parser (3.1.1.0) ast (~> 2.4.1) diff --git a/sorbet/rbi/gems/package_protections@0.64.0.rbi b/sorbet/rbi/gems/package_protections@1.4.0.rbi similarity index 83% rename from sorbet/rbi/gems/package_protections@0.64.0.rbi rename to sorbet/rbi/gems/package_protections@1.4.0.rbi index 1c842e8..fad7230 100644 --- a/sorbet/rbi/gems/package_protections@0.64.0.rbi +++ b/sorbet/rbi/gems/package_protections@1.4.0.rbi @@ -12,6 +12,9 @@ module PackageProtections sig { void } def bust_cache!; end + sig { params(blk: T.proc.params(arg0: ::PackageProtections::Private::Configuration).void).void } + def configure(&blk); end + sig do params( packages: T::Array[::ParsePackwerk::Package], @@ -20,14 +23,6 @@ module PackageProtections end def get_offenses(packages:, new_violations:); end - sig do - params( - package_names: T::Array[::String], - all_packages: T::Array[::ParsePackwerk::Package] - ).returns(T::Array[::ParsePackwerk::Package]) - end - def packages_for_names(package_names, all_packages); end - sig { params(identifier: ::String).returns(T::Hash[T.untyped, T.untyped]) } def private_cop_config(identifier); end @@ -102,6 +97,9 @@ module PackageProtections::Private sig { void } def bust_cache!; end + sig { returns(::PackageProtections::Private::Configuration) } + def config; end + sig do params( packages: T::Array[::ParsePackwerk::Package], @@ -113,14 +111,6 @@ module PackageProtections::Private sig { params(name: ::String).returns(::PackageProtections::ProtectedPackage) } def get_package_with_name(name); end - sig do - params( - package_names: T::Array[::String], - all_packages: T::Array[::ParsePackwerk::Package] - ).returns(T::Array[::ParsePackwerk::Package]) - end - def packages_for_names(package_names, all_packages); end - sig { params(identifier: ::String).returns(T::Hash[T.untyped, T.untyped]) } def private_cop_config(identifier); end @@ -195,6 +185,23 @@ class PackageProtections::Private::ColorizedString::Color < ::T::Enum end end +class PackageProtections::Private::Configuration + sig { void } + def initialize; end + + sig { void } + def bust_cache!; end + + sig { returns(T::Array[::PackageProtections::ProtectionInterface]) } + def default_protections; end + + sig { returns(T::Array[::PackageProtections::ProtectionInterface]) } + def protections; end + + sig { params(protections: T::Array[::PackageProtections::ProtectionInterface]).void } + def protections=(protections); end +end + class PackageProtections::Private::IncomingPrivacyProtection include ::PackageProtections::ProtectionInterface @@ -256,51 +263,6 @@ class PackageProtections::Private::MetadataModifiers end end -class PackageProtections::Private::MultipleNamespacesProtection - include ::PackageProtections::ProtectionInterface - include ::PackageProtections::RubocopProtectionInterface - - sig do - override - .params( - packages: T::Array[::PackageProtections::ProtectedPackage] - ).returns(T::Array[::PackageProtections::RubocopProtectionInterface::CopConfig]) - end - def cop_configs(packages); end - - sig { params(package: ::PackageProtections::ProtectedPackage).returns(T::Hash[T.untyped, T.untyped]) } - def custom_cop_config(package); end - - sig do - override - .params( - protected_packages: T::Array[::PackageProtections::ProtectedPackage] - ).returns(T::Array[::PackageProtections::Offense]) - end - def get_offenses_for_existing_violations(protected_packages); end - - sig { override.returns(::String) } - def humanized_protection_description; end - - sig { override.returns(::String) } - def humanized_protection_name; end - - sig { override.returns(::String) } - def identifier; end - - sig do - override - .params( - behavior: ::PackageProtections::ViolationBehavior, - package: ::ParsePackwerk::Package - ).returns(T.nilable(::String)) - end - def unmet_preconditions_for_behavior(behavior, package); end -end - -PackageProtections::Private::MultipleNamespacesProtection::COP_NAME = T.let(T.unsafe(nil), String) -PackageProtections::Private::MultipleNamespacesProtection::IDENTIFIER = T.let(T.unsafe(nil), String) - class PackageProtections::Private::OutgoingDependencyProtection include ::PackageProtections::ProtectionInterface @@ -359,48 +321,6 @@ class PackageProtections::Private::Output end end -class PackageProtections::Private::TypedApiProtection - include ::PackageProtections::ProtectionInterface - include ::PackageProtections::RubocopProtectionInterface - - sig do - override - .params( - packages: T::Array[::PackageProtections::ProtectedPackage] - ).returns(T::Array[::PackageProtections::RubocopProtectionInterface::CopConfig]) - end - def cop_configs(packages); end - - sig do - override - .params( - protected_packages: T::Array[::PackageProtections::ProtectedPackage] - ).returns(T::Array[::PackageProtections::Offense]) - end - def get_offenses_for_existing_violations(protected_packages); end - - sig { override.returns(::String) } - def humanized_protection_description; end - - sig { override.returns(::String) } - def humanized_protection_name; end - - sig { override.returns(::String) } - def identifier; end - - sig do - override - .params( - behavior: ::PackageProtections::ViolationBehavior, - package: ::ParsePackwerk::Package - ).returns(T.nilable(::String)) - end - def unmet_preconditions_for_behavior(behavior, package); end -end - -PackageProtections::Private::TypedApiProtection::COP_NAME = T.let(T.unsafe(nil), String) -PackageProtections::Private::TypedApiProtection::IDENTIFIER = T.let(T.unsafe(nil), String) - class PackageProtections::Private::VisibilityProtection include ::PackageProtections::ProtectionInterface @@ -560,16 +480,26 @@ module PackageProtections::RubocopProtectionInterface abstract! sig do - abstract - .params( - packages: T::Array[::PackageProtections::ProtectedPackage] - ).returns(T::Array[::PackageProtections::RubocopProtectionInterface::CopConfig]) + params( + packages: T::Array[::PackageProtections::ProtectedPackage] + ).returns(T::Array[::PackageProtections::RubocopProtectionInterface::CopConfig]) end def cop_configs(packages); end + sig { abstract.returns(::String) } + def cop_name; end + sig { params(package: ::PackageProtections::ProtectedPackage).returns(T::Hash[T.untyped, T.untyped]) } def custom_cop_config(package); end + sig do + override + .params( + protected_packages: T::Array[::PackageProtections::ProtectedPackage] + ).returns(T::Array[::PackageProtections::Offense]) + end + def get_offenses_for_existing_violations(protected_packages); end + sig do override .params( @@ -578,6 +508,21 @@ module PackageProtections::RubocopProtectionInterface end def get_offenses_for_new_violations(new_violations); end + sig { abstract.returns(T::Array[::String]) } + def included_globs_for_pack; end + + sig { abstract.params(file: ::String).returns(::String) } + def message_for_fail_on_any(file); end + + sig do + override + .params( + behavior: ::PackageProtections::ViolationBehavior, + package: ::ParsePackwerk::Package + ).returns(T.nilable(::String)) + end + def unmet_preconditions_for_behavior(behavior, package); end + private sig { params(rule: ::String).returns(T::Set[::String]) } @@ -630,3 +575,7 @@ class PackageProtections::ViolationBehavior < ::T::Enum def from_raw_value(value); end end end + +module RuboCop; end +module RuboCop::Cop; end +module RuboCop::Cop::PackageProtections; end diff --git a/sorbet/rbi/gems/parse_packwerk@0.10.0.rbi b/sorbet/rbi/gems/parse_packwerk@0.12.0.rbi similarity index 95% rename from sorbet/rbi/gems/parse_packwerk@0.10.0.rbi rename to sorbet/rbi/gems/parse_packwerk@0.12.0.rbi index a1b7c06..af8d82f 100644 --- a/sorbet/rbi/gems/parse_packwerk@0.10.0.rbi +++ b/sorbet/rbi/gems/parse_packwerk@0.12.0.rbi @@ -9,9 +9,15 @@ module ParsePackwerk sig { returns(T::Array[::ParsePackwerk::Package]) } def all; end + sig { void } + def bust_cache!; end + sig { params(name: ::String).returns(T.nilable(::ParsePackwerk::Package)) } def find(name); end + sig { params(file_path: T.any(::Pathname, ::String)).returns(T.nilable(::ParsePackwerk::Package)) } + def package_from_path(file_path); end + sig { params(package: ::ParsePackwerk::Package).void } def write_package_yml!(package); end