Skip to content

Commit 22d6429

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Remove createVarAutofixArgs function
1 parent e23699f commit 22d6429

File tree

1 file changed

+9
-32
lines changed

1 file changed

+9
-32
lines changed

extensions/ql-vscode/src/variant-analysis/view-autofixes.ts

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ async function runAutofixOnResults(
617617
alertNumber?: number, // Optional parameter for specific alert
618618
): Promise<void> {
619619
// Set up args for autofix command.
620-
const fixedAutofixArgs = [
620+
const autofixArgs = [
621621
"--sarif",
622622
sarifFile,
623623
"--source-root",
@@ -630,15 +630,18 @@ async function runAutofixOnResults(
630630
"text",
631631
"--diff-style",
632632
"diff", // could do "text" instead if want line of "=" between fixes
633-
];
634-
const varAutofixArgs = createVarAutofixArgs(
633+
"--output",
635634
outputTextFilePath,
635+
"--fix-description",
636636
fixDescriptionFilePath,
637+
"--transcript",
637638
transcriptFilePath,
638-
alertNumber,
639-
);
639+
];
640640

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+
}
642645

643646
await execAutofix(
644647
logger,
@@ -655,32 +658,6 @@ async function runAutofixOnResults(
655658
);
656659
}
657660

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-
684661
/**
685662
* Executes the autofix command.
686663
*/

0 commit comments

Comments
 (0)