From b3a438e79cb1b16e8f892ab418f2f071fe6c21d3 Mon Sep 17 00:00:00 2001 From: David Corson-Knowles Date: Wed, 30 Sep 2026 13:53:19 -0700 Subject: [PATCH] Drop the unused rubocop-packs dependency PackwerkCheckerUsage requires rubocop-packs but uses nothing from it: it only tallies enforce_* keys read from package.yml. The require is left over from the package_protections removal (#21), and it made every consumer install rubocop-packs and load RuboCop at runtime. Removes the require, the gemspec dependency, the tapioca require and the gem RBI, and bumps to 0.2.2 so the change publishes. Co-Authored-By: Claude Opus 5.5 --- Gemfile.lock | 12 +- .../private/metrics/packwerk_checker_usage.rb | 2 - pack_stats.gemspec | 3 +- sorbet/rbi/gems/rubocop-packs@0.0.45.rbi | 433 ------------------ sorbet/tapioca/require.rb | 1 - 5 files changed, 2 insertions(+), 449 deletions(-) delete mode 100644 sorbet/rbi/gems/rubocop-packs@0.0.45.rbi diff --git a/Gemfile.lock b/Gemfile.lock index e794aa3..8cb0380 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,13 +1,12 @@ PATH remote: . specs: - pack_stats (0.2.1) + pack_stats (0.2.2) code_ownership code_teams dogapi packs parse_packwerk - rubocop-packs sorbet-runtime GEM @@ -186,15 +185,6 @@ GEM rubocop-sorbet (>= 0.13.0) smart_todo thor - rubocop-packs (0.0.45) - activesupport - base64 - bigdecimal - packs-specification - parse_packwerk - rubocop (~> 1.0) - rubocop-sorbet (>= 0.8.4) - sorbet-runtime rubocop-performance (1.27.0) lint_roller (~> 1.1) rubocop (>= 1.89.0, < 2.0) diff --git a/lib/pack_stats/private/metrics/packwerk_checker_usage.rb b/lib/pack_stats/private/metrics/packwerk_checker_usage.rb index c53394b..c8b4d22 100644 --- a/lib/pack_stats/private/metrics/packwerk_checker_usage.rb +++ b/lib/pack_stats/private/metrics/packwerk_checker_usage.rb @@ -1,8 +1,6 @@ # typed: strict # frozen_string_literal: true -require "rubocop-packs" - module PackStats module Private module Metrics diff --git a/pack_stats.gemspec b/pack_stats.gemspec index 3bec3a1..5cf1c87 100644 --- a/pack_stats.gemspec +++ b/pack_stats.gemspec @@ -1,7 +1,7 @@ # frozen_string_literal: true Gem::Specification.new do |spec| spec.name = "pack_stats" - spec.version = "0.2.1" + spec.version = "0.2.2" spec.authors = ["Gusto Engineers"] spec.email = ["dev@gusto.com"] @@ -35,7 +35,6 @@ Gem::Specification.new do |spec| spec.add_dependency("dogapi") spec.add_dependency("packs") spec.add_dependency("parse_packwerk") - spec.add_dependency("rubocop-packs") spec.add_dependency("sorbet-runtime") spec.add_development_dependency("base64") diff --git a/sorbet/rbi/gems/rubocop-packs@0.0.45.rbi b/sorbet/rbi/gems/rubocop-packs@0.0.45.rbi deleted file mode 100644 index dc988d6..0000000 --- a/sorbet/rbi/gems/rubocop-packs@0.0.45.rbi +++ /dev/null @@ -1,433 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `rubocop-packs` gem. -# Please instead update this file by running `bin/tapioca gem rubocop-packs`. - - -# The original code is from https://github.com/rubocop/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb -# See https://github.com/rubocop/rubocop-rspec/blob/master/MIT-LICENSE.md -# -# pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:4 -module RuboCop; end - -# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/private.rb:4 -module RuboCop::Cop; end - -# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:5 -module RuboCop::Cop::Packs; end - -# This cop states that public API should live on class methods, which are more easily statically analyzable, -# searchable, and typically hold less state. -# -# Options: -# -# * `AcceptableParentClasses`: A list of classes that, if inherited from, non-class methods are permitted (useful when value objects are a part of your public API) -# * `AcceptableMixins`: A list of modules that, if included, non-class methods are permitted -# -# @example -# -# # bad -# # packs/foo/app/public/foo.rb -# module Foo -# def blah -# end -# end -# -# # good -# # packs/foo/app/public/foo.rb -# module Foo -# def self.blah -# end -# end -# -# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/class_methods_as_public_apis.rb:31 -class RuboCop::Cop::Packs::ClassMethodsAsPublicApis < ::RuboCop::Cop::Base - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/class_methods_as_public_apis.rb:40 - sig { params(node: T.untyped).void } - def on_def(node); end - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/class_methods_as_public_apis.rb:35 - sig { returns(T::Boolean) } - def support_autocorrect?; end - - private - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/class_methods_as_public_apis.rb:70 - sig { params(node: T.untyped).returns(T::Boolean) } - def node_includes_acceptable_mixin?(node); end -end - -# This cop helps ensure that each pack has a documented public API -# The following examples assume this basic setup. -# -# @example -# -# # bad -# # packs/foo/app/public/foo.rb -# class Foo -# def bar; end -# end -# -# # good -# # packs/foo/app/public/foo.rb -# class Foo -# # This is a documentation comment. -# def bar; end -# end -# -# # good -# # packs/foo/app/public/foo.rb -# class Foo -# # This is a documentation comment. -# # It should appear above a sorbet type signature -# sig { void } -# def bar; end -# end -# -# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/documented_public_apis.rb:33 -class RuboCop::Cop::Packs::DocumentedPublicApis < ::RuboCop::Cop::Style::DocumentationMethod - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/documented_public_apis.rb:51 - sig { params(node: T.untyped).void } - def check(node); end - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/documented_public_apis.rb:74 - sig { params(node: T.untyped).returns(T::Boolean) } - def node_is_sorbet_signature?(node); end - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/documented_public_apis.rb:46 - sig { returns(T::Boolean) } - def support_autocorrect?; end -end - -# This cop helps ensure that each pack exposes one namespace. -# Note that this cop doesn't necessarily expect you to be using packs-rails (https://github.com/rubyatscale/packs-rails), -# but it does expect packs to live in the organizational structure as described in the README.md of that gem. -# -# This allows packs to opt in and also prevent *other* files from sitting in their namespace. -# -# @example -# -# # bad -# # packs/foo/app/services/blah/bar.rb -# class Blah::Bar; end -# -# # good -# # packs/foo/app/services/foo/blah/bar.rb -# class Foo::Blah::Bar; end -# -# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:6 -class RuboCop::Cop::Packs::RootNamespaceIsPackName < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name.rb:32 - sig { void } - def on_new_investigation; end - - # In the future, we'd love this to support auto-correct. - # Perhaps by automatically renamespacing the file and changing its location? - # - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name.rb:79 - sig { returns(T::Boolean) } - def support_autocorrect?; end - - private - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name.rb:86 - sig { returns(::RuboCop::Cop::Packs::RootNamespaceIsPackName::DesiredZeitwerkApi) } - def desired_zeitwerk_api; end -end - -# This is a private class that represents API that we would prefer to be available somehow in Zeitwerk. -# However, the boundaries between systems (packwerk/zeitwerk, rubocop/zeitwerk) are poor in this class, so -# that would need to be separated prior to proposing any API changes in zeitwerk. -# -# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:12 -class RuboCop::Cop::Packs::RootNamespaceIsPackName::DesiredZeitwerkApi - # For now, this API includes `package_for_path` - # If this were truly zeitwerk API, it wouldn't include any mention of packs and it would likely not need the package at all - # Since it could get the actual namespace without knowing anything about packs. - # However, we would need to pass to it the desired namespace based on the pack name for it to be able to suggest - # a desired filepath. - # Likely this means that our own cop should determine the desired namespace and pass that in - # and this can determine actual namespace and how to get to expected. - # - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:32 - sig do - params( - relative_filename: ::String, - package_for_path: ::Packs::Pack - ).returns(T.nilable(::RuboCop::Cop::Packs::RootNamespaceIsPackName::DesiredZeitwerkApi::NamespaceContext)) - end - def for_file(relative_filename, package_for_path); end - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:86 - sig { params(pack: ::Packs::Pack).returns(::String) } - def get_pack_based_namespace(pack); end - - private - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:98 - sig { params(remaining_file_path: ::String, package_name: ::String).returns(::String) } - def get_actual_namespace(remaining_file_path, package_name); end - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:93 - sig { returns(::Pathname) } - def root_pathname; end -end - -# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:15 -class RuboCop::Cop::Packs::RootNamespaceIsPackName::DesiredZeitwerkApi::NamespaceContext < ::T::Struct - const :current_namespace, ::String - const :current_fully_qualified_constant, ::String - const :expected_namespace, ::String - const :expected_filepath, ::String -end - -# This cop helps ensure that each pack's public API is strictly typed, enforcing strong boundaries. -# -# @example -# -# # bad -# # packs/foo/app/public/foo.rb -# module Foo; end -# -# # good -# # packs/foo/app/public/foo.rb -# module Foo; end -# -# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/typed_public_apis.rb:22 -class RuboCop::Cop::Packs::TypedPublicApis < ::RuboCop::Cop::Sorbet::StrictSigil - # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/typed_public_apis.rb:38 - sig { void } - def on_new_investigation; end -end - -# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/private.rb:5 -module RuboCop::Cop::PackwerkLite; end - -# This is a private class that represents API that we would prefer to be available somehow in Zeitwerk. -# However, the boundaries between systems (packwerk/zeitwerk, rubocop/zeitwerk) are poor in this class, so -# that would need to be separated prior to proposing any API changes in zeitwerk. -# -# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/constant_resolver.rb:11 -class RuboCop::Cop::PackwerkLite::ConstantResolver; end - -# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/constant_resolver.rb:14 -class RuboCop::Cop::PackwerkLite::ConstantResolver::ConstantReference < ::T::Struct - const :constant_name, ::String - const :global_namespace, ::String - const :source_package, ::ParsePackwerk::Package - const :constant_definition_location, ::Pathname - const :referencing_file, ::Pathname - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/constant_resolver.rb:29 - sig { returns(T::Boolean) } - def public_api?; end - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/constant_resolver.rb:24 - sig { returns(::ParsePackwerk::Package) } - def referencing_package; end - - class << self - # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/constant_resolver.rb:37 - sig do - params( - node: ::RuboCop::AST::ConstNode, - processed_source: ::RuboCop::AST::ProcessedSource - ).returns(T.nilable(::RuboCop::Cop::PackwerkLite::ConstantResolver::ConstantReference)) - end - def resolve(node, processed_source); end - end -end - -# This cop helps ensure that packs are depending on packs explicitly. -# -# @example -# -# # bad -# # packs/foo/app/services/foo.rb -# class Foo -# def bar -# Bar -# end -# end -# -# # packs/foo/package.yml -# # enforces_dependencies: true -# # enforces_privacy: false -# # dependencies: -# # - packs/baz -# -# # good -# # packs/foo/app/services/foo.rb -# class Foo -# def bar -# Bar -# end -# end -# -# # packs/foo/package.yml -# # enforces_dependencies: true -# # enforces_privacy: false -# # dependencies: -# # - packs/baz -# # - packs/bar -# -# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/dependency_checker.rb:39 -class RuboCop::Cop::PackwerkLite::Dependency < ::RuboCop::Cop::Base - # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/dependency_checker.rb:48 - sig { params(node: ::RuboCop::AST::ConstNode).void } - def on_const(node); end - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/dependency_checker.rb:43 - sig { returns(T::Boolean) } - def support_autocorrect?; end -end - -# This cop helps ensure that packs are using public API of other systems -# The following examples assume this basic setup. -# -# @example -# # packs/bar/app/public/bar.rb -# class Bar -# def my_public_api; end -# end -# -# # packs/bar/app/services/private.rb -# class Private -# def my_private_api; end -# end -# -# # packs/bar/package.yml -# # enforces_dependencies: false -# # enforces_privacy: true -# -# # bad -# # packs/foo/app/services/foo.rb -# class Foo -# def bar -# Private.my_private_api -# end -# end -# -# # good -# # packs/foo/app/services/foo.rb -# class Bar -# def bar -# Bar.my_public_api -# end -# end -# -# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/privacy_checker.rb:40 -class RuboCop::Cop::PackwerkLite::Privacy < ::RuboCop::Cop::Base - # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/privacy_checker.rb:49 - sig { params(node: ::RuboCop::AST::ConstNode).void } - def on_const(node); end - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/privacy_checker.rb:44 - sig { returns(T::Boolean) } - def support_autocorrect?; end -end - -# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/private.rb:6 -module RuboCop::Cop::PackwerkLite::Private - class << self - # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/private.rb:10 - sig { params(node: ::RuboCop::AST::ConstNode).returns(T::Boolean) } - def partial_const_reference?(node); end - - # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/private.rb:27 - sig do - params( - constant_reference: ::RuboCop::Cop::PackwerkLite::ConstantResolver::ConstantReference, - type: ::String - ).returns(T::Boolean) - end - def violation_in_package_todo_yml?(constant_reference, type: T.unsafe(nil)); end - end -end - -# pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:5 -module RuboCop::Packs - class << self - # pkg:gem/rubocop-packs#lib/rubocop/packs.rb:16 - sig { void } - def bust_cache!; end - - # pkg:gem/rubocop-packs#lib/rubocop/packs.rb:27 - sig { returns(::RuboCop::Packs::Private::Configuration) } - def config; end - - # pkg:gem/rubocop-packs#lib/rubocop/packs.rb:22 - sig { params(blk: T.proc.params(arg0: ::RuboCop::Packs::Private::Configuration).void).void } - def configure(&blk); end - end -end - -# pkg:gem/rubocop-packs#lib/rubocop/packs.rb:11 -RuboCop::Packs::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname) - -# Because RuboCop doesn't yet support plugins, we have to monkey patch in a -# bit of our configuration. -# -# pkg:gem/rubocop-packs#lib/rubocop/packs/inject.rb:10 -module RuboCop::Packs::Inject - class << self - # pkg:gem/rubocop-packs#lib/rubocop/packs/inject.rb:14 - sig { void } - def defaults!; end - end -end - -# pkg:gem/rubocop-packs#lib/rubocop/packs.rb:10 -RuboCop::Packs::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname) - -# pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:6 -module RuboCop::Packs::Private - class << self - # pkg:gem/rubocop-packs#lib/rubocop/packs/private.rb:13 - sig { void } - def bust_cache!; end - - # pkg:gem/rubocop-packs#lib/rubocop/packs/private.rb:18 - sig { void } - def load_client_configuration; end - end -end - -# pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:7 -class RuboCop::Packs::Private::Configuration - # pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:14 - sig { void } - def initialize; end - - # pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:19 - sig { void } - def bust_cache!; end - - # pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:11 - sig { returns(T::Array[::String]) } - def globally_permitted_namespaces; end - - # pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:11 - def globally_permitted_namespaces=(_arg0); end -end - -# pkg:gem/rubocop-packs#lib/rubocop/packs/private/offense.rb:6 -class RuboCop::Packs::Private::Offense < ::T::Struct - const :cop_name, ::String - const :filepath, ::String - - # pkg:gem/rubocop-packs#lib/rubocop/packs/private/offense.rb:13 - sig { returns(T.nilable(::Packs::Pack)) } - def pack; end -end - -# See docs/packwerk_lite.md -# -# pkg:gem/rubocop-packs#lib/rubocop/packwerk_lite.rb:12 -module RuboCop::PackwerkLite; end - -# pkg:gem/rubocop-packs#lib/rubocop/packwerk_lite.rb:13 -class RuboCop::PackwerkLite::Error < ::StandardError; end diff --git a/sorbet/tapioca/require.rb b/sorbet/tapioca/require.rb index 8fa0e54..9d5e585 100644 --- a/sorbet/tapioca/require.rb +++ b/sorbet/tapioca/require.rb @@ -28,6 +28,5 @@ require "parse_packwerk" require "pathname" require "pry" -require "rubocop-packs" require "sorbet-runtime" require "yaml"