Skip to content

Drop the unused rubocop-packs dependency - #76

Merged
joemsak merged 1 commit into
rubyatscale:mainfrom
corsonknowles:drop-unused-rubocop-packs
Sep 30, 2026
Merged

joemsak merged 1 commit into
rubyatscale:mainfrom
corsonknowles:drop-unused-rubocop-packs

Conversation

@corsonknowles

Copy link
Copy Markdown
Contributor

Why

lib/pack_stats/private/metrics/packwerk_checker_usage.rb does require "rubocop-packs" but never uses anything from it. The class only reads enforce_* keys from each package.yml and tallies them. The require is left over from dropping package_protections (#21).

Because of it, every app that installs pack_stats also gets rubocop-packs in its bundle and loads RuboCop at runtime. Gusto/zenpayroll has turned off every Packs/* and PackwerkLite/* cop and is removing its own rubocop-packs dependency, and this require is the only thing keeping the gem in its bundle.

What changes

  • Removes the require from packwerk_checker_usage.rb and from sorbet/tapioca/require.rb
  • Removes rubocop-packs from the gemspec's runtime dependencies. The lockfile change is pruning only: every transitive dependency of rubocop-packs is still required by something else.
  • Deletes sorbet/rbi/gems/rubocop-packs@0.0.45.rbi
  • Bumps the version to 0.2.2 so CD publishes the change

Verification

These ran locally on Ruby 3.4.11, since 4.0.7 isn't installed on my machine. The gemspec allows >= 3.3.

  • bundle exec rspec: 19 examples, 0 failures
  • bundle exec srb tc: no errors
  • bundle exec rubocop: 20 files, no offenses
  • require "pack_stats" loads with RuboCop left undefined

Unrelated, found while checking this: the "emits metrics about rubocop exclusions" example in spec/pack_stats/pack_stats_spec.rb has an empty body. It's another leftover from the same removal, so I've left it for a separate cleanup.

🤖 Generated with Claude Code

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 (rubyatscale#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 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants