Sha256: 80f238af176e9f5d46af46d695a5b92bef6db4d293280b4ee962ddd09e30ab78

Contents?: true

Size: 694 Bytes

Versions: 2

Compression:

Stored size: 694 Bytes

Contents

# frozen_string_literal: true

module WhatDyaReturn
  module AST
    #
    # Override `RuboCop::AST::ProcessedSource#create_parser` to
    # use `WhatDyaReturn::AST::Builder` instead of `RuboCop::AST::Builder`
    #
    class ProcessedSource < ::RuboCop::AST::ProcessedSource
      def create_parser(ruby_version)
        builder = Builder.new

        parser_class(ruby_version).new(builder).tap do |parser|
          parser.diagnostics.all_errors_are_fatal = (RUBY_ENGINE != 'ruby')
          parser.diagnostics.ignore_warnings = false
          parser.diagnostics.consumer = lambda do |diagnostic|
            @diagnostics << diagnostic
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
what_dya_return-0.2.1 lib/what_dya_return/ast/processed_source.rb
what_dya_return-0.2.0 lib/what_dya_return/ast/processed_source.rb