Sha256: 7a4200465ace482fa0f6c344815f8e35b4e9381b20170704ed2544759f31b253

Contents?: true

Size: 759 Bytes

Versions: 16

Compression:

Stored size: 759 Bytes

Contents

# frozen_string_literal: true

require "rubocop"

module RuboCop
  module Cop
    module Sorbet
      # Disallows using `T.untyped` anywhere.
      #
      # @example
      #
      #   # bad
      #   sig { params(my_argument: T.untyped).void }
      #   def foo(my_argument); end
      #
      #   # good
      #   sig { params(my_argument: String).void }
      #   def foo(my_argument); end
      #
      class ForbidTUntyped < RuboCop::Cop::Base
        MSG = "Do not use `T.untyped`."
        RESTRICT_ON_SEND = [:untyped].freeze

        # @!method t_untyped?(node)
        def_node_matcher(:t_untyped?, "(send (const nil? :T) :untyped)")

        def on_send(node)
          add_offense(node) if t_untyped?(node)
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rubocop-sorbet-0.8.7 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.8.6 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.8.5 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.8.4 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.8.3 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.8.2 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.8.1 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.8.0 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.7.8 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.7.7 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.7.6 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.7.5 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.7.4 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.7.3 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.7.2 lib/rubocop/cop/sorbet/forbid_t_untyped.rb
rubocop-sorbet-0.7.1 lib/rubocop/cop/sorbet/forbid_t_untyped.rb