Skip to content

Commit 34b845c

Browse files
t3dotggclaude
andcommitted
fix(scripts): use Schema.TaggedError for the missing Kotlin tool error
Main no longer exports Schema.TaggedErrorClass. Tests now check the tag and missing commands, not the exact message text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f6cd041 commit 34b845c

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

‎scripts/mobile-native-static-check.test.ts‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,11 @@ it.effect("fails when ktlint or detekt is missing instead of skipping", () =>
1616
return assert.fail(`Unexpected error: ${ktlintError._tag}`);
1717
}
1818
assert.deepEqual(ktlintError.commands, ["ktlint"]);
19-
assert.equal(
20-
ktlintError.message,
21-
"ktlint is not installed; cannot run Kotlin static analysis. Install via `brew bundle install --file apps/mobile/Brewfile` or put the JVM tools on PATH.",
22-
);
2319

2420
const bothError = yield* requireKotlinTools({ ktlint: false, detekt: false }).pipe(Effect.flip);
2521
if (bothError._tag !== "NativeStaticCheckMissingToolError") {
2622
return assert.fail(`Unexpected error: ${bothError._tag}`);
2723
}
2824
assert.deepEqual(bothError.commands, ["ktlint", "detekt"]);
29-
assert.equal(
30-
bothError.message,
31-
"ktlint and detekt are not installed; cannot run Kotlin static analysis. Install via `brew bundle install --file apps/mobile/Brewfile` or put the JVM tools on PATH.",
32-
);
3325
}),
3426
);

‎scripts/mobile-native-static-check.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class NativeStaticCheckCommandError extends Schema.TaggedError<NativeStat
6565

6666
const kotlinToolCommands = ["ktlint", "detekt"] as const;
6767

68-
export class NativeStaticCheckMissingToolError extends Schema.TaggedErrorClass<NativeStaticCheckMissingToolError>()(
68+
export class NativeStaticCheckMissingToolError extends Schema.TaggedError<NativeStaticCheckMissingToolError>()(
6969
"NativeStaticCheckMissingToolError",
7070
{
7171
commands: Schema.Array(Schema.Literals(kotlinToolCommands)),

0 commit comments

Comments
 (0)