Class: SlimLint::Linter::ControlStatementSpacing
- Inherits:
-
SlimLint::Linter
- Object
- SlimLint::Linter
- SlimLint::Linter::ControlStatementSpacing
- Includes:
- SlimLint::LinterRegistry
- Defined in:
- lib/slim_lint/linter/control_statement_spacing.rb
Overview
Checks for missing or superfluous spacing before and after control statements.
Instance Attribute Summary
Attributes inherited from SlimLint::Linter
Attributes included from SexpVisitor::DSL
Instance Method Summary collapse
Methods included from SlimLint::LinterRegistry
extract_linters_from, included
Methods inherited from SlimLint::Linter
Methods included from SexpVisitor::DSL
#anything, #capture, #on, #on_start
Methods included from SexpVisitor
#captures, #on_start, #patterns, #traverse, #traverse_children, #trigger_pattern_callbacks
Constructor Details
This class inherits a constructor from SlimLint::Linter
Instance Method Details
#after_config ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/slim_lint/linter/control_statement_spacing.rb', line 19 def after_config @after_config ||= case config["space_after"] when "never", false, nil [/^ *-#?[^# ]/, "remove spaces after"] when "always", "single", true [/^ *-#? [^ ]/, "use one space after"] when "ignore", "any" [//, ""] else raise ArgumentError, "Unknown value for `space_after`; please use 'never' or 'always'" end end |