Class: RuboCop::Cop::Sorbet::ForbidTLet
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Sorbet::ForbidTLet
- Extended by:
- AutoCorrector
- Includes:
- RBSAssertionCorrection
- Defined in:
- lib/rubocop/cop/sorbet/forbid_t_let.rb
Overview
Disallows using T.let anywhere.
Set AutocorrectToRBS: true to replace supported calls with RBS inline comments.
Constant Summary collapse
- MSG =
"Do not use `T.let`."- RESTRICT_ON_SEND =
[:let].freeze
Constants included from RBSAssertionCorrection
RBSAssertionCorrection::COMMENT_START, RBSAssertionCorrection::NEWLINES
Instance Method Summary collapse
- #on_send(node) ⇒ Object (also: #on_csend)
- #t_let?(node) ⇒ Object
Instance Method Details
#on_send(node) ⇒ Object Also known as: on_csend
29 30 31 32 33 |
# File 'lib/rubocop/cop/sorbet/forbid_t_let.rb', line 29 def on_send(node) return unless t_let?(node) add_offense(node) { |corrector| autocorrect_t_let_to_rbs(corrector, node) } end |
#t_let?(node) ⇒ Object
27 |
# File 'lib/rubocop/cop/sorbet/forbid_t_let.rb', line 27 def_node_matcher(:t_let?, "(send (const nil? :T) :let _ _)") |