Sha256: 9e195e0ddb19cc42efff363b0fb128001cf6221f7990b0c218582f5a1ea20cd8

Contents?: true

Size: 819 Bytes

Versions: 5

Compression:

Stored size: 819 Bytes

Contents

# typed: strict
# frozen_string_literal: true

module Spoom
  module Deadcode
    module Plugins
      class ActiveSupport < Base
        ignore_classes_inheriting_from("ActiveSupport::TestCase")

        ignore_methods_named(
          "after_all",
          "after_setup",
          "after_teardown",
          "before_all",
          "before_setup",
          "before_teardown",
        )

        SETUP_AND_TEARDOWN_METHODS = T.let(["setup", "teardown"], T::Array[String])

        sig { override.params(send: Send).void }
        def on_send(send)
          return unless send.recv.nil? && SETUP_AND_TEARDOWN_METHODS.include?(send.name)

          send.each_arg(Prism::SymbolNode) do |arg|
            @index.reference_method(T.must(arg.value), send.location)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spoom-1.5.0 lib/spoom/deadcode/plugins/active_support.rb
spoom-1.4.2 lib/spoom/deadcode/plugins/active_support.rb
spoom-1.4.1 lib/spoom/deadcode/plugins/active_support.rb
spoom-1.4.0 lib/spoom/deadcode/plugins/active_support.rb
spoom-1.3.3 lib/spoom/deadcode/plugins/active_support.rb