Sha256: 0726889439f51ab3d07a33fbd760e996f621c100a0de443914abc56a543e43c1

Contents?: true

Size: 501 Bytes

Versions: 4

Compression:

Stored size: 501 Bytes

Contents

# encoding: utf-8

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

      def inspect(source, tokens, ast, comments)
        source.each_with_index do |line, index|
          max = LineLength.max
          if line.length > max
            message = sprintf(MSG, line.length, max)
            add_offence(:convention, index + 1, message)
          end
        end
      end

      def self.max
        LineLength.config['Max']
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-0.8.3 lib/rubocop/cop/line_length.rb
rubocop-0.8.2 lib/rubocop/cop/line_length.rb
rubocop-0.8.1 lib/rubocop/cop/line_length.rb
rubocop-0.8.0 lib/rubocop/cop/line_length.rb