diff --git a/src/codeql.ts b/src/codeql.ts index b4fa4c395..28ba2243e 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -909,8 +909,8 @@ export async function getCodeQLForCmd( // We may be exporting diagnostics for a failed SARIF, in which case the configuration // file may not have been written to disk and there may not be a database. The CLI // will produce a SARIF for diagnostics from `diagnosticDir` without it. Therefore, - // if `diagnosticDir` is set, we check whether `configPath` exists and only provide - // it to the CLI if it does. Although not needed, the CLI will produce an error if it + // we check whether `configPath` exists and only provide it to the CLI if it does. + // Although not needed, the CLI will produce an error if it // is provided with an argument to `--sarif-codescanning-config` that does not exist. let configPath: string | undefined = getGeneratedCodeScanningConfigPath(config); diff --git a/src/diagnostics.test.ts b/src/diagnostics.test.ts index 0d9af674d..39ed95b20 100644 --- a/src/diagnostics.test.ts +++ b/src/diagnostics.test.ts @@ -66,7 +66,7 @@ test("getTempLanguageDiagnosticsPath returns language-specific path if a languag ); })); -test("getDatabaseDiagnosticsPath returns language-specific path if a language is provided", async (t) => +test("getDatabaseDiagnosticsPath returns language-specific path", async (t) => withTmpDir(async (tmpDir) => { t.is( diagnostics.getDatabaseDiagnosticsPath( diff --git a/src/diagnostics.ts b/src/diagnostics.ts index 5e5bf2156..bec1d28ab 100644 --- a/src/diagnostics.ts +++ b/src/diagnostics.ts @@ -137,7 +137,7 @@ export function makeDiagnostic( } /** - * Gets a path relative to {@link basePath} where diagnostics for to {@link language} should be stored at. + * Gets a path relative to {@link basePath} where diagnostics for {@link language} should be stored at. */ export function getLanguageDiagnosticsPath( basePath: string, @@ -200,7 +200,7 @@ export function addDiagnostic( : config.dbLocation; // Check that the database exists before writing to it. If the database does not yet exist, - // store the diagnostic in memory and write it later. + // store the diagnostic in a temporary location and move it to the database later. if (fs.existsSync(databasePath)) { writeDiagnostic({ logger }, config, language, diagnostic); } else {