File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 11import { ScanResult } from '../types' ;
2+ import { RULES } from '../types/rules' ;
23import pkg from '../../package.json' ;
34
45interface SarifLog {
@@ -14,6 +15,7 @@ export function toSarif(results: ScanResult[], repoRoot: string): SarifLog {
1415 const rulesMap = new Map < string , any > ( ) ;
1516 const sarifResults = results . map ( ( r ) => {
1617 if ( ! rulesMap . has ( r . ruleId ) ) {
18+ const meta = ( RULES as any ) [ r . ruleId ] ;
1719 rulesMap . set ( r . ruleId , {
1820 id : r . ruleId ,
1921 name : r . ruleId ,
@@ -27,7 +29,8 @@ export function toSarif(results: ScanResult[], repoRoot: string): SarifLog {
2729 defaultConfiguration : {
2830 level : r . type === 'error' ? 'error' : r . type === 'warning' ? 'warning' : 'note' ,
2931 } ,
30- help : { text : r . fix || '' } ,
32+ help : { text : r . fix || ( meta ?. fix || '' ) } ,
33+ helpUri : meta ?. helpUri ,
3134 } ) ;
3235 }
3336 const level = r . type === 'error' ? 'error' : r . type === 'warning' ? 'warning' : 'note' ;
You can’t perform that action at this time.
0 commit comments