Sha256: 91f64800fe8cec0d9f1e131e9c566a3946be43b213e0cd3e93c0f4b87ce58d5c

Contents?: true

Size: 381 Bytes

Versions: 18

Compression:

Stored size: 381 Bytes

Contents

# encoding: utf-8

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

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rubocop-0.7.2 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.7.1 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.7.0 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.6.1 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.6.0 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.5.0 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.4.6 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.4.5 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.4.4 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.4.3 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.4.2 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.4.1 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.4.0 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.3.2 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.3.1 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.3.0 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.2.1 lib/rubocop/cop/trailing_whitespace.rb
rubocop-0.2.0 lib/rubocop/cop/trailing_whitespace.rb