Class: MonkeyLens::Formatter::SARIF
- Inherits:
-
Object
- Object
- MonkeyLens::Formatter::SARIF
- Defined in:
- lib/monkey_lens/formatter/sarif.rb
Constant Summary collapse
- LEVELS =
{"low" => "note", "medium" => "warning", "high" => "error", "critical" => "error"}.freeze
Instance Method Summary collapse
-
#initialize(result) ⇒ SARIF
constructor
A new instance of SARIF.
- #render ⇒ Object
Constructor Details
#initialize(result) ⇒ SARIF
Returns a new instance of SARIF.
10 11 12 |
# File 'lib/monkey_lens/formatter/sarif.rb', line 10 def initialize(result) @result = result end |
Instance Method Details
#render ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/monkey_lens/formatter/sarif.rb', line 14 def render ::JSON.pretty_generate( { "$schema" => "https://json.schemastore.org/sarif-2.1.0.json", "version" => "2.1.0", "runs" => [{ "tool" => {"driver" => {"name" => "MonkeyLens", "version" => MonkeyLens::VERSION, "rules" => rules}}, "results" => results }] } ) end |