Skip to content

Adopt Shopify's Ruby style guide (rubocop-shopify) - #13

Merged
JPDuchesne merged 2 commits into
mainfrom
jpd/rubocop-shopify
Jul 24, 2026
Merged

Adopt Shopify's Ruby style guide (rubocop-shopify)#13
JPDuchesne merged 2 commits into
mainfrom
jpd/rubocop-shopify

Conversation

@JPDuchesne

Copy link
Copy Markdown
Contributor

Summary

  • Adds rubocop-shopify and a minimal .rubocop.yml inheriting Shopify's config (SuggestExtensions: false; TargetRubyVersion inferred from the gemspec floor).
  • Pinned ~> 2.18: rubocop-shopify >= 3.0 requires Ruby >= 3.3, and main still supports 3.2. The ~> 3.0 bump rides along with Line-aligned emission: source-true backtraces and debuggers by construction #12, which raises our floor to 3.3. Style rules are essentially identical between the two (3.0 was the Ruby-floor/plugin-API major).
  • Brings the codebase fully clean — no .rubocop_todo.yml. Mostly safe autocorrect (string quotes, layout, call parens); a handful of hand fixes: extract_transformation de-duplicated across its identical branches, @@source_maps to a class instance var, safe navigation in MixinUtils.try_super, class << self in TransformationHelper.
  • Enforced via a new dev style command and a CI lint job (single Ruby 4.0, matching the local toolchain; cop behavior is pinned by the inferred target version, not the interpreter).

Lands before #12 on purpose: #12 then rebases onto the linted main so its review diff is style-clean.

Test plan

  • bundle exec rubocop: 30 files, no offenses
  • bundle exec rake test: 44 tests green
  • CI lint + test matrix green

Made with Cursor

Inherit rubocop-shopify's config (pinned ~> 2.18 while the gem still
supports Ruby 3.2; >= 3.0 requires Ruby 3.3), bring the codebase clean
with no rubocop_todo, and enforce it through a dev style command and a
CI lint job.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.61538% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/ast_transform/transformation.rb 66.66% 5 Missing ⚠️
lib/ast_transform.rb 77.77% 2 Missing ⚠️
...t_transform/instruction_sequence/bootsnap_mixin.rb 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

The lockfile resolved rubocop's parallel dependency to 2.1.0, which
requires Ruby >= 3.3 and broke bundle install on the 3.2 CI job.

Co-authored-by: Cursor <cursoragent@cursor.com>
@JPDuchesne
JPDuchesne merged commit 590e7b8 into main Jul 24, 2026
5 checks passed
@JPDuchesne
JPDuchesne deleted the jpd/rubocop-shopify branch July 24, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant