Class: Querly::CLI::Formatter::Base

Inherits:
Object
  • Object
show all
Includes:
Querly::Concerns::BacktraceFormatter
Defined in:
lib/querly/cli/formatter.rb

Direct Known Subclasses

JSON, Text

Instance Method Summary collapse

Methods included from Querly::Concerns::BacktraceFormatter

#format_backtrace

Instance Method Details

#config_error(path, error) ⇒ Object

Called when failed to load config Exit(status == 0) after the call



15
# File 'lib/querly/cli/formatter.rb', line 15

def config_error(path, error); end

#config_load(config) ⇒ Object

Called when config is successfully loaded



11
# File 'lib/querly/cli/formatter.rb', line 11

def config_load(config); end

#fatal_error(error) ⇒ Object

Called on other error Abort(status != 0) after the call



29
30
31
32
33
# File 'lib/querly/cli/formatter.rb', line 29

def fatal_error(error)
  STDERR.puts Rainbow("Fatal error: #{error}").red
  STDERR.puts "Backtrace:"
  STDERR.puts format_backtrace(error.backtrace)
end

#finishObject

Called on exit/abort



36
# File 'lib/querly/cli/formatter.rb', line 36

def finish; end

#issue_found(script, rule, pair) ⇒ Object

Called when issue is found



25
# File 'lib/querly/cli/formatter.rb', line 25

def issue_found(script, rule, pair); end

#script_error(path, error) ⇒ Object

Called when failed to load script Continue after the call



22
# File 'lib/querly/cli/formatter.rb', line 22

def script_error(path, error); end

#script_load(script) ⇒ Object

Called when script is successfully loaded



18
# File 'lib/querly/cli/formatter.rb', line 18

def script_load(script); end

#startObject

Called when analyzer started



8
# File 'lib/querly/cli/formatter.rb', line 8

def start; end