Sha256: 13d95da801e48329ab7273a296a08dadcc63eb362bf2b528b77be4f01a1fce7f

Contents?: true

Size: 938 Bytes

Versions: 9

Compression:

Stored size: 938 Bytes

Contents

module Steep
  module Drivers
    class Annotations
      attr_reader :source_paths
      attr_reader :stdout
      attr_reader :stderr
      attr_reader :labeling

      include Utils::EachSignature

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

        @labeling = ASTUtils::Labeling.new
      end

      def run
        each_ruby_source(source_paths, false) do |source|
          source.each_annotation.sort_by {|node, _| [node.loc.expression.begin_pos, node.loc.expression.end_pos] }.each do |node, annotations|
            loc = node.loc
            stdout.puts "#{source.path}:#{loc.line}:#{loc.column}:#{node.type}:\t#{node.loc.expression.source.lines.first}"
            annotations.each do |annotation|
              stdout.puts "  #{annotation.location.source}"
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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