Class: LintTrappings::Command::Scan

Inherits:
Base
  • Object
show all
Defined in:
lib/lint_trappings/command/scan.rb

Overview

Scan for lints, outputting report of results using the specified formatter.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from LintTrappings::Command::Base

Instance Method Details

#runObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/lint_trappings/command/scan.rb', line 4

def run
  LintTrappings::LinterLoader.new(application, config).load(options)

  runner = LintTrappings::Runner.new(application, config, output)
  report = runner.run(options)

  if report.failures?
    raise LintTrappings::ScanFailed,
          'High severity lints were reported!'
  elsif report.warnings?
    raise LintTrappings::ScanWarned,
          'Warnings were reported.'
  end
end