Skip to content

Translator to RBS only removes extend T::Helpers when needed #751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 9, 2025

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Jun 5, 2025

In this case, we shouldn't remove the extend T::Helpers as we still need it for mixes_in_class_methods:

module Foo
  extend T::Helpers

  mixes_in_class_methods Bar

@Morriar Morriar self-assigned this Jun 5, 2025
@Morriar Morriar requested a review from a team as a code owner June 5, 2025 16:41
@Morriar Morriar added the bugfix Fix a bug label Jun 5, 2025
Comment on lines +105 to +114
old_class_annotations = @class_annotations
@class_annotations = []
old_type_members = @type_members
@type_members = []
old_extend_t_helpers = @extend_t_helpers
@extend_t_helpers = []
old_extend_t_generics = @extend_t_generics
@extend_t_generics = []
old_seen_mixes_in_class_methods = @seen_mixes_in_class_methods
@seen_mixes_in_class_methods = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Personally, I find this style easier to follow:

Suggested change
old_class_annotations = @class_annotations
@class_annotations = []
old_type_members = @type_members
@type_members = []
old_extend_t_helpers = @extend_t_helpers
@extend_t_helpers = []
old_extend_t_generics = @extend_t_generics
@extend_t_generics = []
old_seen_mixes_in_class_methods = @seen_mixes_in_class_methods
@seen_mixes_in_class_methods = false
old_class_annotations, @class_annotations = @class_annotations, []
old_type_members, @type_members = @type_members, []
old_extend_t_helpers, @extend_t_helpers = @extend_t_helpers, []
old_extend_t_generics, @extend_t_generics = @extend_t_generics, []
old_seen_mixes_in_class_methods, @seen_mixes_in_class_methods = @seen_mixes_in_class_methods, false

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it but Rubocop doesn't:

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no worries then it's good to ship already 👍

Morriar added 3 commits June 6, 2025 10:59
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar merged commit 0bfaf25 into main Jun 9, 2025
8 checks passed
@Morriar Morriar deleted the at-fix-mixes branch June 9, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fix a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants