Sha256: c789b021b5a32e9bdc73bd28638de50d6878aae17af88f40675929465b638ae4

Contents?: true

Size: 489 Bytes

Versions: 12

Compression:

Stored size: 489 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module RBS
      module Lint
        # Just only for syntax error
        class Syntax < RuboCop::RBS::CopBase
          def on_rbs_parsing_error
            e = processed_rbs_source.error or raise
            message = "#{e.error_message}, token=`#{e.location.source}` (#{e.token_type})"
            add_offense(location_to_range(e.location), message:, severity: :fatal)
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rubocop-on-rbs-1.3.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-1.2.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-1.1.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-1.0.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-0.9.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-0.8.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-0.7.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-0.6.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-0.5.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-0.4.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-0.3.0 lib/rubocop/cop/rbs/lint/syntax.rb
rubocop-on-rbs-0.2.0 lib/rubocop/cop/rbs/lint/syntax.rb