Sha256: acc8a802f1c4750775741ed988f5b16a44cf04a78814f14ce75dd6673487fb74

Contents?: true

Size: 638 Bytes

Versions: 3

Compression:

Stored size: 638 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    module Style
      # This cop checks for Windows-style line endings in the source code.
      class EndOfLine < Cop
        MSG = 'Carriage return character detected.'

        def inspect(source_buffer, source, tokens, ast, comments)
          source.each_with_index do |line, index|
            if line =~ /\r$/
              add_offence(:convention,
                          source_range(source_buffer, source[0...index],
                                       line.length - 1, 1),
                          MSG)
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
rubocop-0.9.1 lib/rubocop/cop/style/end_of_line.rb
sabat-rubocop-0.9.0 lib/rubocop/cop/style/end_of_line.rb
rubocop-0.9.0 lib/rubocop/cop/style/end_of_line.rb