Class: RuboCop::Cop::Sorbet::ForbidTBind
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Sorbet::ForbidTBind
- Defined in:
- lib/rubocop/cop/sorbet/forbid_t_bind.rb
Overview
Disallows using ‘T.bind` anywhere.
Constant Summary collapse
- MSG =
"Do not use `T.bind`."- RESTRICT_ON_SEND =
[:bind].freeze
Instance Method Summary collapse
- #on_send(node) ⇒ Object (also: #on_csend)
- #t_bind?(node) ⇒ Object
Instance Method Details
#on_send(node) ⇒ Object Also known as: on_csend
24 25 26 |
# File 'lib/rubocop/cop/sorbet/forbid_t_bind.rb', line 24 def on_send(node) add_offense(node) if t_bind?(node) end |
#t_bind?(node) ⇒ Object
22 |
# File 'lib/rubocop/cop/sorbet/forbid_t_bind.rb', line 22 def_node_matcher(:t_bind?, "(send (const nil? :T) :bind _ _)") |