class HamlLint::Linter::TrailingWhitespace

Checks for trailing whitespace.

Constants

DummyNode

Public Instance Methods

visit_root(root) click to toggle source
# File lib/haml_lint/linter/trailing_whitespace.rb, line 10
def visit_root(root)
  document.source_lines.each_with_index do |line, index|
    next unless line =~ /\s+$/

    node = root.node_for_line(index + 1)
    unless node.disabled?(self)
      record_lint DummyNode.new(index + 1), 'Line contains trailing whitespace'
    end
  end
end