Class: HamlLint::Linter::TrailingWhitespace
- Inherits:
-
HamlLint::Linter
- Object
- HamlLint::Linter
- HamlLint::Linter::TrailingWhitespace
- Includes:
- HamlLint::LinterRegistry
- Defined in:
- lib/haml_lint/linter/trailing_whitespace.rb
Overview
Checks for trailing whitespace.
Instance Attribute Summary
Attributes inherited from HamlLint::Linter
Instance Method Summary collapse
Methods included from HamlLint::LinterRegistry
extract_linters_from, included
Methods inherited from HamlLint::Linter
Methods included from HamlVisitor
Constructor Details
This class inherits a constructor from HamlLint::Linter
Instance Method Details
#visit_root(_node) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/haml_lint/linter/trailing_whitespace.rb', line 6 def visit_root(_node) dummy_node = Struct.new(:line) document.source_lines.each_with_index do |line, index| next unless line =~ /\s+$/ record_lint dummy_node.new(index + 1), 'Line contains trailing whitespace' end end |