lib/scss_lint/linter/indentation.rb in scss-lint-0.12.1 vs lib/scss_lint/linter/indentation.rb in scss-lint-0.13.0
- old
+ new
@@ -2,23 +2,24 @@
# Checks for consistent indentation of nested declarations and rule sets.
class Linter::Indentation < Linter
include LinterRegistry
def visit_root(node)
+ @indent_width = config['width']
@indent = 0
yield
end
def check_and_visit_children(node)
# Don't continue checking children as the moment a parent's indentation is
# off it's likely the children will be as will. We don't display the child
# indentation problems as that would likely make the lint too noisy.
return if check_indentation(node)
- @indent += INDENT_WIDTH
+ @indent += @indent_width
yield
- @indent -= INDENT_WIDTH
+ @indent -= @indent_width
end
def check_indentation(node)
return unless node.line
@@ -62,11 +63,7 @@
alias :visit_extend :check_indentation
alias :visit_import :check_indentation
alias :visit_return :check_indentation
alias :visit_variable :check_indentation
alias :visit_warn :check_indentation
-
- private
-
- INDENT_WIDTH = 2
end
end