Class: HamlLint::LinterSelector
- Inherits:
-
Object
- Object
- HamlLint::LinterSelector
- Defined in:
- lib/haml_lint/linter_selector.rb
Overview
Chooses the appropriate linters to run given the specified configuration.
Instance Method Summary collapse
-
#initialize(config, options) ⇒ LinterSelector
constructor
Creates a selector using the given configuration and additional options.
-
#linters_for_file(file) ⇒ Array<HamlLint::Linter>
Returns the set of linters to run against the given file.
Constructor Details
#initialize(config, options) ⇒ LinterSelector
Creates a selector using the given configuration and additional options.
10 11 12 13 |
# File 'lib/haml_lint/linter_selector.rb', line 10 def initialize(config, ) @config = config @options = end |
Instance Method Details
#linters_for_file(file) ⇒ Array<HamlLint::Linter>
Returns the set of linters to run against the given file.
20 21 22 23 |
# File 'lib/haml_lint/linter_selector.rb', line 20 def linters_for_file(file) @linters ||= extract_enabled_linters(@config, @options) @linters.select { |linter| run_linter_on_file?(@config, linter, file) } end |