@@ -617,7 +617,7 @@ async function runAutofixOnResults(
617
617
alertNumber ?: number , // Optional parameter for specific alert
618
618
) : Promise < void > {
619
619
// Set up args for autofix command.
620
- const fixedAutofixArgs = [
620
+ const autofixArgs = [
621
621
"--sarif" ,
622
622
sarifFile ,
623
623
"--source-root" ,
@@ -630,15 +630,18 @@ async function runAutofixOnResults(
630
630
"text" ,
631
631
"--diff-style" ,
632
632
"diff" , // could do "text" instead if want line of "=" between fixes
633
- ] ;
634
- const varAutofixArgs = createVarAutofixArgs (
633
+ "--output" ,
635
634
outputTextFilePath ,
635
+ "--fix-description" ,
636
636
fixDescriptionFilePath ,
637
+ "--transcript" ,
637
638
transcriptFilePath ,
638
- alertNumber ,
639
- ) ;
639
+ ] ;
640
640
641
- const autofixArgs = [ ...fixedAutofixArgs , ...varAutofixArgs ] ;
641
+ // Add alert number argument if provided
642
+ if ( alertNumber !== undefined ) {
643
+ autofixArgs . push ( "--only-alert-number" , alertNumber . toString ( ) ) ;
644
+ }
642
645
643
646
await execAutofix (
644
647
logger ,
@@ -655,32 +658,6 @@ async function runAutofixOnResults(
655
658
) ;
656
659
}
657
660
658
- /**
659
- * Creates autofix arguments that vary depending on the run.
660
- */
661
- function createVarAutofixArgs (
662
- outputTextFilePath : string ,
663
- fixDescriptionFilePath : string ,
664
- transcriptFilePath : string ,
665
- alertNumber ?: number , // Optional parameter for specific alert
666
- ) : string [ ] {
667
- const args = [
668
- "--output" ,
669
- outputTextFilePath ,
670
- "--fix-description" ,
671
- fixDescriptionFilePath ,
672
- "--transcript" ,
673
- transcriptFilePath ,
674
- ] ;
675
-
676
- // Add alert number argument if provided
677
- if ( alertNumber !== undefined ) {
678
- args . push ( "--only-alert-number" , alertNumber . toString ( ) ) ;
679
- }
680
-
681
- return args ;
682
- }
683
-
684
661
/**
685
662
* Executes the autofix command.
686
663
*/
0 commit comments