lib/haml_lint/runner.rb
def extract_enabled_linters(config, options)
      included_linters = LinterRegistry
        .extract_linters_from(options.fetch(:included_linters, []))

      included_linters = LinterRegistry.linters if included_linters.empty?

      excluded_linters = LinterRegistry
        .extract_linters_from(options.fetch(:excluded_linters, []))

      # After filtering out explicitly included/excluded linters, only include
      # linters which are enabled in the configuration
      (included_linters - excluded_linters).map do |linter_class|
        linter_config = config.for_linter(linter_class)
        linter_class.new(linter_config) if linter_config['enabled']
      end.compact
    end
# Runs the appropriate linters against the desired files given the specified
# options.
#
# @param options [Hash]
# @raise [HamlLint::Exceptions::NoLintersError] when no linters are enabled
# @return [HamlLint::Report] a summary of all lints found
Runs the appropriate linters against the desired files given the specified
options.
Runs the appropriate linters against the desired files given the specified options .
def extract_enabled_linters(config, options)
      included_linters = LinterRegistry
        .extract_linters_from(options.fetch(:included_linters, []))
      included_linters = LinterRegistry.linters if included_linters.empty?
      excluded_linters = LinterRegistry
        .extract_linters_from(options.fetch(:excluded_linters, []))
      (included_linters - excluded_linters).map do |linter_class|
        linter_config = config.for_linter(linter_class)
        linter_class.new(linter_config) if linter_config['enabled']
      end.compact
    end
def extract_enabled_linters ( config , options ) included_linters = LinterRegistry . extract_linters_from ( options . fetch ( :included_linters , [ ] ) ) included_linters = LinterRegistry . linters if included_linters . empty? excluded_linters = LinterRegistry . extract_linters_from ( options . fetch ( :excluded_linters , [ ] ) ) ( included_linters - excluded_linters ) . map do | linter_class | linter_config = config . for_linter ( linter_class ) linter_class . new ( linter_config ) if linter_config [ 'enabled' ] end . compact end
Runs the appropriate linters against the desired files given the specified
options.
Runs the appropriate linters against the desired files given the specified options .
# After filtering out explicitly included/excluded linters, only include # linters which are enabled in the configuration
a summary of all lints found
a summary of all lints found
HamlLint::Report
[HamlLint::Exceptions::NoLintersError] when no linters are enabled
[ HamlLint :: Exceptions :: NoLintersError ] when no linters are enabled
config
options
None