Sha256: 7ecc6677cfc00a67c43713d36763b6db16847b0aa8e1ec8eb6c62dadf6fdb58a
Contents?: true
Size: 531 Bytes
Versions: 15
Compression:
Stored size: 531 Bytes
Contents
# frozen_string_literal: true module SlimLint # Checks for lines longer than a maximum number of columns. class Linter::LineLength < Linter include LinterRegistry MSG = 'Line is too long. [%d/%d]'.freeze on_start do |_sexp| max_length = config['max'] dummy_node = Struct.new(:line) document.source_lines.each_with_index do |line, index| next if line.length <= max_length report_lint(dummy_node.new(index + 1), format(MSG, line.length, max_length)) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems