Module: HamlLint::LinterRegistry
- Included in:
- HamlLint::Linter::AltText, HamlLint::Linter::ClassAttributeWithStaticValue, HamlLint::Linter::ClassesBeforeIds, HamlLint::Linter::ConsecutiveComments, HamlLint::Linter::ConsecutiveSilentScripts, HamlLint::Linter::EmptyObjectReference, HamlLint::Linter::EmptyScript, HamlLint::Linter::FinalNewline, HamlLint::Linter::HtmlAttributes, HamlLint::Linter::IdNames, HamlLint::Linter::ImplicitDiv, HamlLint::Linter::Indentation, HamlLint::Linter::InlineStyles, HamlLint::Linter::InstanceVariables, HamlLint::Linter::LeadingCommentSpace, HamlLint::Linter::LineLength, HamlLint::Linter::MultilinePipe, HamlLint::Linter::MultilineScript, HamlLint::Linter::NoPlaceholders, HamlLint::Linter::ObjectReferenceAttributes, HamlLint::Linter::RepeatedId, HamlLint::Linter::RuboCop, HamlLint::Linter::RubyComments, HamlLint::Linter::SpaceBeforeScript, HamlLint::Linter::SpaceInsideHashAttributes, HamlLint::Linter::Syntax, HamlLint::Linter::TagName, HamlLint::Linter::TrailingEmptyLines, HamlLint::Linter::TrailingWhitespace, HamlLint::Linter::UnnecessaryInterpolation, HamlLint::Linter::UnnecessaryStringOutput, HamlLint::Linter::ViewLength
- Defined in:
- lib/haml_lint/linter_registry.rb
Overview
Stores all defined linters.
Class Attribute Summary collapse
-
.linters ⇒ Object
readonly
List of all registered linters.
Class Method Summary collapse
-
.extract_linters_from(linter_names) ⇒ Array<Class>
Return a list of Linter Classes corresponding to the specified list of names.
-
.included(subclass) ⇒ Object
Executed when a linter includes the LinterRegistry module.
Class Attribute Details
.linters ⇒ Object (readonly)
List of all registered linters.
12 13 14 |
# File 'lib/haml_lint/linter_registry.rb', line 12 def linters @linters end |
Class Method Details
.extract_linters_from(linter_names) ⇒ Array<Class>
Return a list of HamlLint::Linter Classes corresponding to the specified list of names.
28 29 30 31 32 33 34 |
# File 'lib/haml_lint/linter_registry.rb', line 28 def extract_linters_from(linter_names) linter_names.map do |linter_name| HamlLint::Linter.const_get(linter_name) rescue NameError raise NoSuchLinter, "Linter #{linter_name} does not exist" end end |
.included(subclass) ⇒ Object
Executed when a linter includes the HamlLint::LinterRegistry module.
This results in the linter being registered with the registry.
19 20 21 |
# File 'lib/haml_lint/linter_registry.rb', line 19 def included(subclass) @linters << subclass end |