Sha256: ee8dfe5db5d958a901841cce33e268ae45dab36f0e629143fdf3845456db043e

Contents?: true

Size: 369 Bytes

Versions: 1

Compression:

Stored size: 369 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    class TrailingWhitespace < Cop
      ERROR_MESSAGE = 'Trailing whitespace detected.'

      def inspect(file, source)
        source.each_with_index do |line, index|
          if line =~ /.*[ \t]+$/
            add_offence(:convention, index, line, ERROR_MESSAGE)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubocop-0.1.0 lib/rubocop/cop/trailing_whitespace.rb