Fix inconsistent quoting in diffRangeExtensionPackContents and empty initial line

This commit is contained in:
Michael B. Gale
2026-10-30 13:25:51 +00:00
parent c434c1b9e4
commit 878c513e47
2 changed files with 4 additions and 6 deletions

5
lib/entry-points.js generated
View File

@@ -185926,8 +185926,7 @@ async function setupDiffInformedQueryRun(logger2, checkoutPath) {
);
}
function diffRangeExtensionPackContents(ranges, checkoutPath) {
const header = `
extensions:
const header = `extensions:
- addsTo:
pack: codeql/util
extensible: restrictAlertsTo
@@ -185936,7 +185935,7 @@ extensions:
`;
let data = ranges.map((range2) => {
const filename = path16.join(checkoutPath, range2.path).replaceAll(path16.sep, "/");
return ` - [${dump(filename, { forceQuotes: true, quoteStyle: "single" }).trim()}, ${range2.startLine}, ${range2.endLine}]
return ` - [${dump(filename, { forceQuotes: true, quoteStyle: "double" }).trim()}, ${range2.startLine}, ${range2.endLine}]
`;
}).join("");
if (!data) {

View File

@@ -319,8 +319,7 @@ export function diffRangeExtensionPackContents(
ranges: DiffThunkRange[],
checkoutPath: string,
): string {
const header = `
extensions:
const header = `extensions:
- addsTo:
pack: codeql/util
extensible: restrictAlertsTo
@@ -341,7 +340,7 @@ extensions:
// characters are escaped, and that the path is always rendered as a
// quoted string on a single line.
return (
` - [${yaml.dump(filename, { forceQuotes: true, quoteStyle: "single" }).trim()}, ` +
` - [${yaml.dump(filename, { forceQuotes: true, quoteStyle: "double" }).trim()}, ` +
`${range.startLine}, ${range.endLine}]\n`
);
})