@@ -27,8 +27,9 @@ type SarifReport struct {
2727}
2828
2929type Run struct {
30- Tool Tool `json:"tool"`
31- Results []Result `json:"results"`
30+ Invocations []Invocation `json:"invocations,omitempty"`
31+ Results []Result `json:"results"`
32+ Tool Tool `json:"tool"`
3233}
3334
3435type Tool struct {
@@ -38,7 +39,7 @@ type Tool struct {
3839type Driver struct {
3940 Name string `json:"name"`
4041 Version string `json:"version"`
41- InformationURI string `json:"informationUri,omitempty "`
42+ InformationURI string `json:"informationUri"`
4243 Rules []Rule `json:"rules"`
4344}
4445
@@ -58,10 +59,11 @@ type RuleProperties struct {
5859}
5960
6061type Result struct {
61- RuleID string `json:"ruleId"`
62- Level string `json:"level,omitempty"`
63- Message MessageText `json:"message"`
62+ Level string `json:"level"`
6463 Locations []Location `json:"locations"`
64+ Message MessageText `json:"message"`
65+ RuleID string `json:"ruleId"`
66+ RuleIndex int `json:"ruleIndex,omitempty"`
6567}
6668
6769type Location struct {
@@ -78,16 +80,40 @@ type ArtifactLocation struct {
7880}
7981
8082type Region struct {
81- StartLine int `json:"startLine"`
8283 StartColumn int `json:"startColumn"`
83- EndLine int `json:"endLine,omitempty "`
84+ StartLine int `json:"startLine "`
8485 EndColumn int `json:"endColumn,omitempty"`
86+ EndLine int `json:"endLine,omitempty"`
8587}
8688
8789type MessageText struct {
8890 Text string `json:"text"`
8991}
9092
93+ type Invocation struct {
94+ ExecutionSuccessful bool `json:"executionSuccessful"`
95+ ToolConfigurationNotifications []ToolConfigurationNotification `json:"toolConfigurationNotifications,omitempty"`
96+ ToolExecutionNotifications []ToolExecutionNotification `json:"toolExecutionNotifications,omitempty"`
97+ }
98+
99+ type ToolConfigurationNotification struct {
100+ Descriptor struct {
101+ ID string `json:"id"`
102+ } `json:"descriptor"`
103+ Level string `json:"level"`
104+ Locations []Location `json:"locations"`
105+ Message MessageText `json:"message"`
106+ }
107+
108+ type ToolExecutionNotification struct {
109+ Descriptor struct {
110+ ID string `json:"id"`
111+ } `json:"descriptor"`
112+ Level string `json:"level"`
113+ Locations []Location `json:"locations"`
114+ Message MessageText `json:"message"`
115+ }
116+
91117// ConvertPylintToSarif converts Pylint JSON output to SARIF format
92118func ConvertPylintToSarif (pylintOutput []byte ) []byte {
93119 var issues []PylintIssue
0 commit comments