class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral
Constants
- MSG
Attributes
used_names[RW]
Public Class Methods
new(*)
click to toggle source
Calls superclass method
# File lib/rubocop/cop/sorbet/forbid_include_const_literal.rb, line 40 def initialize(*) super self.used_names = Set.new end
Public Instance Methods
on_send(node)
click to toggle source
# File lib/rubocop/cop/sorbet/forbid_include_const_literal.rb, line 45 def on_send(node) return unless not_lit_const_include?(node) do |send_argument| ![:const, :self].include?(send_argument.type) end parent = node.parent return unless parent parent = parent.parent if [:begin, :block].include?(parent.type) return unless [:module, :class, :sclass].include?(parent.type) add_offense(node) end