Class: HamlLint::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/haml_lint/runner.rb

Overview

Responsible for running the applicable linters against the desired files.

Instance Method Summary collapse

Instance Method Details

#run(options = {}) ⇒ HamlLint::Report

Runs the appropriate linters against the desired files given the specified options.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :config_file (String)

    path of configuration file to load

  • :config (HamlLint::Configuration)

    configuration to use

  • :excluded_files (Array<String>)
  • :included_linters (Array<String>)
  • :excluded_linters (Array<String>)
  • :fail_fast (true, false)

    flag for failing after first failure

  • :fail_level (Object)
  • :reporter (HamlLint::Reporter)

Returns:



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/haml_lint/runner.rb', line 21

def run(options = {})
  @config = load_applicable_config(options)
  @files = extract_applicable_files(config, options)
  @linter_selector = HamlLint::LinterSelector.new(config, options)
  @fail_fast = options.fetch(:fail_fast, false)
  @cache = {}
  @autocorrect = options[:autocorrect]
  @autocorrect_only = options[:autocorrect_only]

  report(options)
end