Sha256: a95cac2db84a66835803212bb287ab1d00bdafb4e6dbe79a27c59c698de5965e

Contents?: true

Size: 475 Bytes

Versions: 3

Compression:

Stored size: 475 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    class LineLength < Cop
      ERROR_MESSAGE = 'Line is too long. [%d/%d]'
      MAX_LINE_LENGTH = 79

      def inspect(file, source, tokens, sexp)
        source.each_with_index do |line, index|
          if line.length > MAX_LINE_LENGTH
            message = sprintf(ERROR_MESSAGE, line.length, MAX_LINE_LENGTH)
            add_offence(:convention, index + 1, message)
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubocop-0.3.0 lib/rubocop/cop/line_length.rb
rubocop-0.2.1 lib/rubocop/cop/line_length.rb
rubocop-0.2.0 lib/rubocop/cop/line_length.rb