From 878c513e4778e298d4e8a1685f5eb111203a87d8 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 30 Oct 2026 13:25:51 +0000 Subject: [PATCH] Fix inconsistent quoting in `diffRangeExtensionPackContents` and empty initial line --- lib/entry-points.js | 5 ++--- src/analyze.ts | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index b2bb9c183..4d5259861 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -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) { diff --git a/src/analyze.ts b/src/analyze.ts index 2da347c13..0c707250a 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -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` ); })