Sha256: 695f13dec993b41495d6c053f00b8fde8572918062ff57c9c8167f5dcfae13e0

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

module Steep
  module Drivers
    class Validate
      attr_reader :signature_dirs
      attr_reader :stdout
      attr_reader :stderr
      attr_accessor :verbose

      def initialize(signature_dirs:, stdout:, stderr:)
        @signature_dirs = signature_dirs
        @stdout = stdout
        @stderr = stderr

        self.verbose = false
      end

      include Utils::EachSignature

      def run
        Steep.logger.level = Logger::DEBUG if verbose

        env = AST::Signature::Env.new

        each_signature(signature_dirs, verbose) do |signature|
          env.add signature
        end

        builder = Interface::Builder.new(signatures: env)
        check = Subtyping::Check.new(builder: builder)

        validator = Utils::Validator.new(stdout: stdout, stderr: stderr, verbose: verbose)

        validator.run(env: env, builder: builder, check: check) do |sig|
          stderr.puts "Validating #{sig.name} (#{sig.location.name}:#{sig.location.start_line})..." if verbose
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
steep-0.7.1 lib/steep/drivers/validate.rb
steep-0.7.0 lib/steep/drivers/validate.rb
steep-0.6.0 lib/steep/drivers/validate.rb
steep-0.5.1 lib/steep/drivers/validate.rb
steep-0.5.0 lib/steep/drivers/validate.rb
steep-0.4.0 lib/steep/drivers/validate.rb
steep-0.3.0 lib/steep/drivers/validate.rb
steep-0.2.0 lib/steep/drivers/validate.rb
steep-0.1.0 lib/steep/drivers/validate.rb