Class: SlimLint::Runner
- Inherits:
-
Object
- Object
- SlimLint::Runner
- Defined in:
- lib/slim_lint/runner.rb
Overview
Responsible for running the applicable linters against the desired files.
Instance Method Summary collapse
-
#run(options = {}) ⇒ SlimLint::Report
Runs the appropriate linters against the desired files given the specified options.
Instance Method Details
#run(options = {}) ⇒ SlimLint::Report
Runs the appropriate linters against the desired files given the specified options.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/slim_lint/runner.rb', line 16 def run( = {}) config = load_applicable_config() linter_selector = SlimLint::LinterSelector.new(config, ) if [:stdin_file_path].nil? files = extract_applicable_files(config, ) lints = files.map do |file| collect_lints(File.read(file), file, linter_selector, config) end.flatten else files = [[:stdin_file_path]] lints = collect_lints($stdin.read, [:stdin_file_path], linter_selector, config) end SlimLint::Report.new(lints, files) end |