Rename isSwiftCompatible

This commit is contained in:
Michael B. Gale
2026-10-23 12:07:19 +01:00
parent 0c057be418
commit fbf3125415
4 changed files with 12 additions and 12 deletions

View File

@@ -12,18 +12,18 @@ import {
} from "../testing-utils";
import { withTmpDir } from "../util";
import { isSwiftCompatible } from "./swift";
import { checkSwiftCompatibility } from "./swift";
import { BuiltInLanguage } from ".";
test("isSwiftCompatible doesn't throw for non-Swift languages", (t) => {
test("checkSwiftCompatibility doesn't throw for non-Swift languages", (t) => {
for (const language of Object.values(BuiltInLanguage)) {
if (language === BuiltInLanguage.swift) {
continue;
}
t.notThrows(() =>
isSwiftCompatible(
checkSwiftCompatibility(
initAllState(),
createTestConfig({ languages: [language] }),
),
@@ -31,7 +31,7 @@ test("isSwiftCompatible doesn't throw for non-Swift languages", (t) => {
}
});
test("isSwiftCompatible doesn't throw for Swift on darwin", async (t) =>
test("checkSwiftCompatibility doesn't throw for Swift on darwin", async (t) =>
withTmpDir(async (tmpDir) => {
const logger = new RecordingLogger();
const env = getTestEnv();
@@ -41,7 +41,7 @@ test("isSwiftCompatible doesn't throw for Swift on darwin", async (t) =>
sinon.stub(codeql, "getVersion").resolves(makeVersionInfo("2.27.0"));
t.notThrows(() =>
isSwiftCompatible(
checkSwiftCompatibility(
initAllState({ platform: "darwin", env, logger }),
createTestConfig({
tempDir: tmpDir,
@@ -53,9 +53,9 @@ test("isSwiftCompatible doesn't throw for Swift on darwin", async (t) =>
const nonDarwinPlatforms: NodeJS.Platform[] = ["linux", "win32"];
for (const nonDarwinPlatform of nonDarwinPlatforms) {
test(`isSwiftCompatible throws for Swift on ${nonDarwinPlatform}`, (t) => {
test(`checkSwiftCompatibility throws for Swift on ${nonDarwinPlatform}`, (t) => {
t.throws(() => {
isSwiftCompatible(
checkSwiftCompatibility(
initAllState({ platform: nonDarwinPlatform }),
createTestConfig({ languages: [BuiltInLanguage.swift] }),
);

View File

@@ -13,7 +13,7 @@ import { BuiltInLanguage } from ".";
* @throws {ConfigurationError} If Swift analysis is not possible on the current runner.
* @returns True if we can run a Swift analysis.
*/
export function isSwiftCompatible(
export function checkSwiftCompatibility(
action: ActionState<["Base"]>,
config: Config,
) {