Skip to content
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

Fix BindingConstantWithoutTypeAlias for type members with arguments #107

Merged
merged 1 commit into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class BindingConstantWithoutTypeAlias < RuboCop::Cop::Cop

def_node_matcher(:generic_parameter_decl_block_call?, <<-PATTERN)
(block
(send nil? {:type_template :type_member}) ...
(send nil? {:type_template :type_member} ...) ...
)
PATTERN

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ def deprecation
expect_no_offenses(<<~RUBY)
A = type_member(fixed: T.untyped)
A = type_member { { fixed: T.class_of(::ActiveRecord::Base) } }
A = type_member(:in) { { fixed: T.untyped } }
RUBY
end

it("allows assigning type_template to a constant") do
expect_no_offenses(<<~RUBY)
A = type_template(fixed: T.untyped)
A = type_template { { fixed: T.class_of(::ActiveRecord::Base) } }
A = type_template(:in) { { fixed: T.untyped } }
RUBY
end

Expand Down