Module: ERBLint::LinterRegistry
- Included in:
- ERBLint::Linters::AllowedScriptType, ERBLint::Linters::ClosingErbTagIndent, ERBLint::Linters::DeprecatedClasses, ERBLint::Linters::ErbSafety, ERBLint::Linters::ExtraNewline, ERBLint::Linters::FinalNewline, ERBLint::Linters::HardCodedString, ERBLint::Linters::NoJavascriptTagHelper, ERBLint::Linters::ParserErrors, ERBLint::Linters::RightTrim, ERBLint::Linters::Rubocop, ERBLint::Linters::RubocopText, ERBLint::Linters::SelfClosingTag, ERBLint::Linters::SpaceAroundErbTag, ERBLint::Linters::SpaceInHtmlTag, ERBLint::Linters::SpaceIndentation, ERBLint::Linters::TrailingWhitespace
- Defined in:
- lib/erb_lint/linter_registry.rb
Overview
Stores all linters available to the application.
Constant Summary collapse
- CUSTOM_LINTERS_DIR =
'.erb-linters'
Class Attribute Summary collapse
-
.linters ⇒ Object
readonly
Returns the value of attribute linters.
Class Method Summary collapse
- .find_by_name(name) ⇒ Object
- .included(linter_class) ⇒ Object
- .load_custom_linters(directory = CUSTOM_LINTERS_DIR) ⇒ Object
Class Attribute Details
.linters ⇒ Object (readonly)
Returns the value of attribute linters.
10 11 12 |
# File 'lib/erb_lint/linter_registry.rb', line 10 def linters @linters end |
Class Method Details
.find_by_name(name) ⇒ Object
16 17 18 |
# File 'lib/erb_lint/linter_registry.rb', line 16 def find_by_name(name) linters.detect { |linter| linter.simple_name == name } end |
.included(linter_class) ⇒ Object
12 13 14 |
# File 'lib/erb_lint/linter_registry.rb', line 12 def included(linter_class) @linters << linter_class end |
.load_custom_linters(directory = CUSTOM_LINTERS_DIR) ⇒ Object
20 21 22 23 |
# File 'lib/erb_lint/linter_registry.rb', line 20 def load_custom_linters(directory = CUSTOM_LINTERS_DIR) ruby_files = Dir.glob(File.(File.join(directory, '**', '*.rb'))) ruby_files.each { |file| require file } end |