Skip to content

Commit bf737c6

Browse files
dduuggclaude
andauthored
Modernize dependencies, fix CI, and add rubocop-gusto (#178)
* Modernize dependencies and fix CI CI tests against Ruby 3.2, 3.3, and 4.0. Several gems were incompatible with Ruby 4.0, causing bundle install to fail. Dependency updates: - Remove git-sourced packwerk override from Gemfile (packwerk 3 is on RubyGems) - Update all outdated gems: activesupport 7 → 8.1, rubocop 1.56 → 1.85, sorbet/tapioca 0.5/0.11 → 0.6/0.16, minitest 5.19 → 6.0, code_ownership 1.34 → 2.1.1 (native Rust gem), and many more - Bump required_ruby_version in gemspec from >= 2.6.0 to >= 3.2 - Remove bundler version pin and spoom version pin Linting: - Autocorrect rubocop offenses (block forwarding, collection querying) - Add .rubocop_todo.yml for Naming/BlockForwarding (Sorbet incompatible with anonymous block forwarding) and Naming/PredicateMethod - Update TargetRubyVersion from 2.6.0 to 3.2 Test fixes for updated gem APIs: - code_ownership 2.1.1 (Rust-based): for_file now defaults to from_codeowners: true; pass from_codeowners: false in CodeOwnershipPostProcessor to use pack-based ownership lookup - code_ownership 2.1.1: team YAML files require github.team field - code_ownership 2.1.1: only recognizes top-level owner: key in package.yml, not metadata.owner; update spec_helper write_package_yml to write owner at top level via config hash - code_ownership 2.1.1: remove_file_annotation! regex requires trailing newline; fix test file to include newline - Psych 5: YAML array items no longer indented under parent key; update test expectations Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Regenerate tapioca RBI files and update bundler to 4.0.7 - Update bundler to 4.0.7 (was 2.7.2) and tapioca to 0.17.10 (was 0.16.11), spoom to 1.7.11 (was 1.6.3), rbs to 4.0.0.dev.5 (was 3.10.3) to match updated dependencies - Add require 'packwerk' to sorbet/tapioca/require.rb so tapioca can generate a populated packwerk RBI - Regenerate all gem RBIs via `tapioca gems --all` for updated versions: - Remove stale RBIs for gems no longer in the lockfile (rubocop-rspec, rubocop-sorbet, ruby-graphviz) - Add new RBIs for new gems (addressable, benchmark, better_html, bigdecimal, byebug, coderay, connection_pool, diff-lcs, drb, erubi, i18n, io-console, json, json-schema, language_server-protocol, lint_roller, logger, loofah, mcp, method_source, netrc, nokogiri, parallel, pastel, prism, pry, pry-byebug, public_suffix, racc, rails-dom-testing, rails-html-sanitizer, rake, rbi, rbs, reline, rexml, require-hooks, securerandom, smart_properties, spoom, tapioca, thor, tsort, tty-color, tty-cursor, tty-reader, tty-screen, tzinfo, unicode-display_width, unicode-emoji, uri, wisper, yard, yard-sorbet, zeitwerk) and versioned renames of existing ones - Fix activesupport, packwerk, rainbow, tty-prompt RBIs with correct content for new gem versions - Verify `bundle exec srb tc` passes with no errors Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Exclude gems with sorbet built-in shims from tapioca generation Gems in https://github.com/sorbet/sorbet/tree/master/rbi/stdlib already have type definitions shipped with sorbet itself, so generating tapioca RBIs for them is redundant. Configure tapioca to exclude these and remove the now-redundant generated RBI files. Excluded: base64, benchmark, bigdecimal, drb, json, logger, racc, reline, rexml, securerandom, tsort, uri Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Add rubocop-gusto as a development dependency and plugin - Add rubocop-gusto to gemspec as a development dependency - Add `plugins: - rubocop-gusto` to .rubocop.yml - Run `rubocop -A` to autocorrect 490 offenses - Regenerate .rubocop_todo.yml for remaining 91 violations that cannot be autocorrected (RSpec/ContextWording, Gusto/NoMetaprogramming, Sorbet/StrictSigil, Sorbet/ConstantsFromStrings, and others) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Configure rubocop inheritance and regenerate .rubocop_todo.yml - Add inherit_mode with merge for Exclude and Include arrays so that exclusions from .rubocop_todo.yml and inherit_gem are merged rather than overridden - Add inherit_gem to pull in rubocop-gusto's default.yml configuration - Regenerate .rubocop_todo.yml from scratch Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Fix Sorbet type check failures introduced by rubocop-gusto autocorrect rubocop-gusto's Sorbet/BlockMethodDefinition cop autocorrected `def` to `define_method` inside the `no_commands` block in cli.rb, which caused Sorbet to be unable to resolve `exit_successfully` and `parse_pack_names` as methods on Packs::CLI. Revert to plain `def` inside the block (keeping the other good changes: filter_map and delete_suffix) and add cli.rb to the Sorbet/BlockMethodDefinition exclude list in .rubocop_todo.yml. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Regenerate rubocop and tapioca binstubs Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Remove disabled Layout cops and autocorrect violations Remove Layout/LineLength, Layout/MultilineMethodCallIndentation, Layout/FirstArgumentIndentation, Layout/ArgumentAlignment, and Layout/BlockEndNewline from .rubocop.yml, then autocorrect the 113 resulting violations. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Revert define_method in cli_spec.rb introduced by Sorbet/BlockMethodDefinition autocorrect Same issue as lib/packs/cli.rb: the Sorbet/BlockMethodDefinition cop converted plain helper defs to define_method inside the RSpec.describe block. Revert to def and add the file to the cop's exclude list. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Resolve Sorbet/BlockMethodDefinition in cli.rb by removing no_commands wrapper Thor 1.x treats private methods as non-commands, making the no_commands wrapper redundant. Replacing it with plain private defs satisfies Sorbet/BlockMethodDefinition without resorting to define_method. Naming/BlockForwarding remains excluded for logging.rb and configuration.rb since anonymous & is incompatible with typed Sorbet block parameter sigs. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Replace define_method with def in spec/packs_spec.rb The rubocop-gusto Sorbet/BlockMethodDefinition autocorrect had converted plain helper defs to define_method inside the RSpec.describe block. Revert to def, move packs_spec.rb from Gusto/NoMetaprogramming to Sorbet/BlockMethodDefinition in .rubocop_todo.yml, and remove its now- unnecessary entry from Gusto/NoMetaprogramming. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Fix Layout/EmptyLines rubocop offense in cli.rb --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent b68b0e6 commit bf737c6

115 files changed

Lines changed: 304703 additions & 34742 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.rubocop.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
inherit_from: .rubocop_todo.yml
2+
3+
inherit_mode:
4+
merge:
5+
- Exclude
6+
- Include
7+
8+
inherit_gem:
9+
rubocop-gusto:
10+
- config/default.yml
11+
12+
plugins:
13+
- rubocop-gusto
14+
115
# The behavior of RuboCop can be controlled via the .rubocop.yml
216
# configuration file. It makes it possible to enable/disable
317
# certain cops (checks) and to alter their behavior if they accept
@@ -13,7 +27,7 @@ AllCops:
1327
SuggestExtensions: false
1428
Exclude:
1529
- vendor/bundle/**/**
16-
TargetRubyVersion: 2.6.0
30+
TargetRubyVersion: 3.2
1731

1832
Metrics/ParameterLists:
1933
Enabled: false
@@ -50,9 +64,6 @@ Style/GuardClause:
5064
Metrics/ModuleLength:
5165
Enabled: false
5266

53-
Layout/LineLength:
54-
Enabled: false
55-
5667
Metrics/BlockLength:
5768
Enabled: false
5869

@@ -93,10 +104,6 @@ Style/EmptyElse:
93104
Style/RedundantCondition:
94105
Enabled: false
95106

96-
# This leads to code that is not very readable at times (very long lines)
97-
Layout/MultilineMethodCallIndentation:
98-
Enabled: false
99-
100107
# Blocks across lines are okay sometimes
101108
Style/BlockDelimiters:
102109
Enabled: false
@@ -105,19 +112,8 @@ Style/BlockDelimiters:
105112
Naming/AccessorMethodName:
106113
Enabled: false
107114

108-
# This leads to code that is not very readable at times (very long lines)
109-
Layout/FirstArgumentIndentation:
110-
Enabled: false
111-
112-
# This leads to code that is not very readable at times (very long lines)
113-
Layout/ArgumentAlignment:
114-
Enabled: false
115-
116115
Style/AccessorGrouping:
117116
Enabled: false
118117

119118
Style/NumericPredicate:
120119
Enabled: false
121-
122-
Layout/BlockEndNewline:
123-
Enabled: false

.rubocop_todo.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 100`
3+
# on 2026-03-05 21:24:10 UTC using RuboCop version 1.85.1.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 8
10+
Gusto/NoMetaprogramming:
11+
Exclude:
12+
- 'lib/packs/cli.rb'
13+
- 'lib/packs/private/interactive_cli/use_cases/interface.rb'
14+
- 'spec/packs/private/cli_spec.rb'
15+
16+
# Offense count: 5
17+
# This cop supports safe autocorrection (--autocorrect).
18+
# Configuration parameters: AllowedPatterns.
19+
Sorbet/BlockMethodDefinition:
20+
Exclude:
21+
- 'spec/packs/private/cli_spec.rb'
22+
- 'spec/packs_spec.rb'
23+
24+
# Offense count: 2
25+
# This cop supports safe autocorrection (--autocorrect).
26+
# Configuration parameters: EnforcedStyle, BlockForwardingName.
27+
# SupportedStyles: anonymous, explicit
28+
Naming/BlockForwarding:
29+
Exclude:
30+
- 'lib/packs/configuration.rb'
31+
- 'lib/packs/logging.rb'
32+
33+
# Offense count: 1
34+
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
35+
# AllowedMethods: call
36+
# WaywardPredicates: infinite?, nonzero?
37+
Naming/PredicateMethod:
38+
Exclude:
39+
- 'lib/packs/configuration.rb'
40+
41+
# Offense count: 1
42+
Performance/MapMethodChain:
43+
Exclude:
44+
- 'lib/packs/private/interactive_cli/use_cases/get_info.rb'
45+
46+
# Offense count: 65
47+
# Configuration parameters: Prefixes, AllowedPatterns.
48+
# Prefixes: when, with, without
49+
RSpec/ContextWording:
50+
Exclude:
51+
- 'spec/packs/private/cli_spec.rb'
52+
- 'spec/packs_spec.rb'
53+
54+
# Offense count: 2
55+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
56+
# SupportedInflectors: default, active_support
57+
RSpec/SpecFilePathFormat:
58+
Exclude:
59+
- 'spec/packs/private/cli_spec.rb'
60+
- 'spec/verify_docs_spec.rb'
61+
62+
# Offense count: 12
63+
Sorbet/ConstantsFromStrings:
64+
Exclude:
65+
- 'spec/packs/private/cli_spec.rb'
66+
- 'spec/packs_spec.rb'
67+
- 'spec/spec_helper.rb'
68+
69+
# Offense count: 2
70+
# This cop supports unsafe autocorrection (--autocorrect-all).
71+
# Configuration parameters: SuggestedStrictness.
72+
Sorbet/StrictSigil:
73+
Exclude:
74+
- 'sorbet/tapioca/require.rb'
75+
- 'spec/spec_helper.rb'

Gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ source 'https://rubygems.org'
22

33
# Specify your gem's dependencies in packs.gemspec
44
gemspec
5-
6-
gem 'packwerk', github: 'Shopify/packwerk', branch: 'main'

0 commit comments

Comments
 (0)