Class: Collie::Reporter::Sarif
- Inherits:
-
Object
- Object
- Collie::Reporter::Sarif
- Defined in:
- lib/collie/reporter/sarif.rb
Overview
SARIF 2.1.0 reporter for code scanning integrations.
Instance Method Summary collapse
Instance Method Details
#report(offenses) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/collie/reporter/sarif.rb', line 9 def report(offenses) JSON.pretty_generate( version: "2.1.0", "$schema": "https://json.schemastore.org/sarif-2.1.0.json", runs: [ { tool: { driver: { name: "Collie", informationUri: "https://github.com/ydah/collie", rules: rules(offenses) } }, results: offenses.map { |offense| result(offense) } } ] ) end |