Class: HamlLint::Linter::Indentation
- Inherits:
-
HamlLint::Linter
- Object
- HamlLint::Linter
- HamlLint::Linter::Indentation
- Includes:
- HamlLint::LinterRegistry
- Defined in:
- lib/haml_lint/linter/indentation.rb
Overview
Checks the character used for indentation.
Constant Summary collapse
- INDENT_REGEX =
Allowed leading indentation for each character type.
{ space: /^[ ]*(?!\t)/, tab: /^\t*(?![ ])/, }.freeze
- LEADING_SPACES_REGEX =
/^( +)(?! )/
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(root) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/haml_lint/linter/indentation.rb', line 14 def visit_root(root) character = config['character'].to_sym check_character(character, root) width = config['width'].to_i check_width(width, root) if character == :space && width > 0 end |