Sha256: 95eab4d16a02db765edd6da1269026d5aecb7edc7ccf88aca3441c1d048e554c
Contents?: true
Size: 524 Bytes
Versions: 23
Compression:
Stored size: 524 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]' 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
23 entries across 23 versions & 1 rubygems
Version | Path |
---|---|
slim_lint-0.17.0 | lib/slim_lint/linter/line_length.rb |
slim_lint-0.16.1 | lib/slim_lint/linter/line_length.rb |
slim_lint-0.16.0 | lib/slim_lint/linter/line_length.rb |