File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,7 +115,8 @@ namespace {
115115 // else if (finding.severity == Severity::warning)
116116 // securitySeverity = 5.1; // We see potential undefined behavior
117117 if (securitySeverity > 0.5 ) {
118- properties[" security-severity" ] = picojson::value (securitySeverity);
118+ // skipped: "security-severity" caused error when uploading to github
119+ // properties["security-severity"] = picojson::value(securitySeverity);
119120 const picojson::array tags{picojson::value (" security" )};
120121 properties[" tags" ] = picojson::value (tags);
121122 }
@@ -139,8 +140,8 @@ namespace {
139140 artifactLocation[" uri" ] = picojson::value (location.getfile (false ));
140141 physicalLocation[" artifactLocation" ] = picojson::value (artifactLocation);
141142 picojson::object region;
142- region[" startLine" ] = picojson::value (static_cast <int64_t >(location.line ));
143- region[" startColumn" ] = picojson::value (static_cast <int64_t >(location.column ));
143+ region[" startLine" ] = picojson::value (static_cast <int64_t >(location.line < 1 ? 1 : location. line ));
144+ region[" startColumn" ] = picojson::value (static_cast <int64_t >(location.column < 1 ? 1 : location. column ));
144145 region[" endLine" ] = region[" startLine" ];
145146 region[" endColumn" ] = region[" startColumn" ];
146147 physicalLocation[" region" ] = picojson::value (region);
Original file line number Diff line number Diff line change @@ -373,7 +373,8 @@ def test_sarif():
373373 assert res ['runs' ][0 ]['results' ][0 ]['ruleId' ] == 'zerodiv'
374374 assert res ['runs' ][0 ]['tool' ]['driver' ]['rules' ][0 ]['id' ] == 'zerodiv'
375375 assert res ['runs' ][0 ]['tool' ]['driver' ]['rules' ][0 ]['properties' ]['precision' ] == 'high'
376- assert res ['runs' ][0 ]['tool' ]['driver' ]['rules' ][0 ]['properties' ]['security-severity' ] > 9.5
376+ # github does not seem to handle "security-severity" well so it's not added
377+ #assert res['runs'][0]['tool']['driver']['rules'][0]['properties']['security-severity'] > 9.5
377378 assert 'security' in res ['runs' ][0 ]['tool' ]['driver' ]['rules' ][0 ]['properties' ]['tags' ]
378379 assert re .match (r'[0-9]+(.[0-9]+)+' , res ['runs' ][0 ]['tool' ]['driver' ]['semanticVersion' ])
379380 assert 'level' in res ['runs' ][0 ]['tool' ]['driver' ]['rules' ][0 ]['defaultConfiguration' ] # #13885
You can’t perform that action at this time.
0 commit comments