Sha256: 0af7e1eeb39cc4b9ac8a6ac093b0b0d7a32e602e2d46413810487569c9b41843
Contents?: true
Size: 549 Bytes
Versions: 12
Compression:
Stored size: 549 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop class LineLength < Cop ERROR_MESSAGE = 'Line is too long. [%d/%d]' def inspect(file, source, tokens, sexp) source.each_with_index do |line, index| max = LineLength.max if line.length > max message = sprintf(ERROR_MESSAGE, line.length, max) add_offence(:convention, index + 1, message) end end end def self.max LineLength.config ? LineLength.config['Max'] || 79 : 79 end end end end
Version data entries
12 entries across 12 versions & 1 rubygems