Skip to content

Commit 5a8e345

Browse files
committed
Fix linitng issues.
1 parent f030ca3 commit 5a8e345

8 files changed

+37
-22
lines changed

lib/analyze-action.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ test("status report fields", async (t) => {
129129
});
130130
});
131131

132-
133132
test("resolveQuerySuiteAlias", (t) => {
134133
// default query suite names should resolve to something language-specific ending in `.qls`.
135134
for (const suite of defaultSuites) {

src/analyze.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import { type CodeQL } from "./codeql";
1414
import * as configUtils from "./config-utils";
1515
import { getJavaTempDependencyDir } from "./dependency-caching";
1616
import { addDiagnostic, makeDiagnostic } from "./diagnostics";
17-
import { DiffThunkRange, readDiffRangesJsonFile } from "./diff-informed-analysis-utils";
17+
import {
18+
DiffThunkRange,
19+
readDiffRangesJsonFile,
20+
} from "./diff-informed-analysis-utils";
1821
import { EnvVar } from "./environment";
1922
import { FeatureEnablement, Feature } from "./feature-flags";
2023
import { KnownLanguage, Language } from "./languages";
@@ -303,12 +306,14 @@ export async function setupDiffInformedQueryRun(
303306
return undefined;
304307
}
305308

306-
const fileCount = new Set(diffRanges.filter((r) => r.path).map((r) => r.path)).size;
309+
const fileCount = new Set(
310+
diffRanges.filter((r) => r.path).map((r) => r.path),
311+
).size;
307312
logger.info(
308313
`Using precomputed diff ranges (${diffRanges.length} ranges across ${fileCount} files).`,
309314
);
310315

311-
const packDir = writeDiffRangeDataExtensionPack(logger, diffRanges);
316+
const packDir = writeDiffRangeDataExtensionPack(logger, diffRanges);
312317
if (packDir === undefined) {
313318
logger.warning(
314319
"Cannot create diff range extension pack for diff-informed queries; " +
@@ -324,8 +329,6 @@ export async function setupDiffInformedQueryRun(
324329
);
325330
}
326331

327-
328-
329332
/**
330333
* Create an extension pack in the temporary directory that contains the file
331334
* line ranges that were added or modified in the pull request.
@@ -406,7 +409,6 @@ extensions:
406409
`Wrote pr-diff-range extension pack to ${extensionFilePath}:\n${extensionContents}`,
407410
);
408411

409-
410412
return diffRangeDir;
411413
}
412414

src/diff-informed-analysis-utils.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import * as sinon from "sinon";
44
import * as actionsUtil from "./actions-util";
55
import type { PullRequestBranches } from "./actions-util";
66
import * as apiClient from "./api-client";
7-
import { shouldPerformDiffInformedAnalysis } from "./diff-informed-analysis-utils";
7+
import {
8+
shouldPerformDiffInformedAnalysis,
9+
exportedForTesting as diffExportedForTesting,
10+
} from "./diff-informed-analysis-utils";
811
import { Feature, Features } from "./feature-flags";
912
import { getRunnerLogger } from "./logging";
1013
import { parseRepositoryNwo } from "./repository";
@@ -187,8 +190,6 @@ test(
187190
// ---------------------------------------------------------------------------
188191
// Tests for getDiffRanges (moved from analyze.test.ts after extraction)
189192
// ---------------------------------------------------------------------------
190-
import { exportedForTesting as diffExportedForTesting } from "./diff-informed-analysis-utils";
191-
192193
function runGetDiffRanges(changes: number, patch: string[] | undefined): any {
193194
sinon
194195
.stub(actionsUtil, "getRequiredInput")

src/diff-informed-analysis-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import * as fs from "fs";
22
import * as path from "path";
33

4-
import * as actionsUtil from "./actions-util";
54
import type { PullRequestBranches } from "./actions-util";
5+
import * as actionsUtil from "./actions-util";
6+
import { getRequiredInput } from "./actions-util";
67
import { getGitHubVersion, getApiClient } from "./api-client";
78
import type { CodeQL } from "./codeql";
89
import { Feature, FeatureEnablement } from "./feature-flags";
910
import { Logger } from "./logging";
10-
import { GitHubVariant, satisfiesGHESVersion } from "./util";
1111
import { getRepositoryNwoFromEnv } from "./repository";
12-
import { getRequiredInput } from "./actions-util";
12+
import { GitHubVariant, satisfiesGHESVersion } from "./util";
1313

1414
/**
1515
* This interface is an abbreviated version of the file diff object returned by

src/init-action.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ import {
3333
logUnwrittenDiagnostics,
3434
makeDiagnostic,
3535
} from "./diagnostics";
36+
import {
37+
getPullRequestEditedDiffRanges,
38+
writeDiffRangesJsonFile,
39+
getDiffInformedAnalysisBranches,
40+
} from "./diff-informed-analysis-utils";
3641
import { EnvVar } from "./environment";
3742
import { Feature, Features } from "./feature-flags";
3843
import { loadPropertiesFromApi } from "./feature-flags/properties";
@@ -66,11 +71,6 @@ import { ZstdAvailability } from "./tar";
6671
import { ToolsDownloadStatusReport } from "./tools-download";
6772
import { ToolsFeature } from "./tools-features";
6873
import { getCombinedTracerConfig } from "./tracer-config";
69-
import {
70-
getPullRequestEditedDiffRanges,
71-
writeDiffRangesJsonFile,
72-
getDiffInformedAnalysisBranches,
73-
} from "./diff-informed-analysis-utils";
7474
import {
7575
checkDiskUsage,
7676
checkForTimeout,
@@ -343,7 +343,11 @@ async function run() {
343343

344344
await checkInstallPython311(config.languages, codeql);
345345

346-
prDiffChangedFiles = await computeAndPersistDiffRanges(codeql, features, logger);
346+
prDiffChangedFiles = await computeAndPersistDiffRanges(
347+
codeql,
348+
features,
349+
logger,
350+
);
347351
} catch (unwrappedError) {
348352
const error = wrapError(unwrappedError);
349353
core.setFailed(error.message);

src/overlay-database-utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ export async function writeOverlayChangesFile(
133133
for (const f of prDiffChangedFiles) {
134134
if (!existing.has(f)) {
135135
// Only include if file still exists (added/modified) — skip deleted files that might appear in diff.
136-
if (overlayFileOids[f] !== undefined || fs.existsSync(path.join(sourceRoot, f))) {
136+
if (
137+
overlayFileOids[f] !== undefined ||
138+
fs.existsSync(path.join(sourceRoot, f))
139+
) {
137140
existing.add(f);
138141
changedFiles.push(f);
139142
extraAddedCount++;

0 commit comments

Comments
 (0)