Class: Txray::Reporters::Github

Inherits:
Object
  • Object
show all
Defined in:
lib/txray/reporters/github.rb

Constant Summary collapse

LEVELS =
{ high: "error", medium: "warning", low: "notice" }.freeze
SUMMARY_LIMIT =
50

Instance Method Summary collapse

Constructor Details

#initialize(io: $stdout, summary_path: ENV.fetch("GITHUB_STEP_SUMMARY", nil)) ⇒ Github

Returns a new instance of Github.



9
10
11
12
# File 'lib/txray/reporters/github.rb', line 9

def initialize(io: $stdout, summary_path: ENV.fetch("GITHUB_STEP_SUMMARY", nil))
  @io = io
  @summary_path = summary_path
end

Instance Method Details

#report(result) ⇒ Object



14
15
16
17
# File 'lib/txray/reporters/github.rb', line 14

def report(result)
  result.offenses.each { |offense| @io.puts annotation(offense) }
  write_summary(result)
end