Skip to content

Commit 99b7eaf

Browse files
skulidropekclaude
andcommitted
fix(lint,test): fix remaining unicorn violations and apply Biome http→https auto-fix
Lint: - errors.ts, gitlab-token-preflight.ts: convert remaining || === chains to .includes() Biome auto-fix (useHttpsProtocol and other rules applied to test files): - terminal-session-client.test.ts: mock URL http→https; update ws:// expectation to wss:// - controller-health.test.ts: http://controller.testhttps://controller.test - controller-ready.test.ts: DOCKER_GIT_API_URL and expectations http→https - controller-revision.test.ts: .split("/")[0] → .split("/", 1)[0] - app-ready-create-fixture.ts: " " → " ".repeat(3) - menu-shared.test.ts: arrow function formatting CI setup: bump bun CI runner from 1.3.11 to 1.3.14 to match local dev environment All 448 tests pass locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 79e4d4f commit 99b7eaf

9 files changed

Lines changed: 15 additions & 21 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
bun-version:
55
description: The version of Bun to install
66
required: true
7-
default: 1.3.11
7+
default: 1.3.14
88
node-version:
99
description: The version of Node.js to install for compatibility/native builds
1010
required: true

packages/app/src/lib/usecases/errors.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,7 @@ export type AppError =
4848
type NonParseError = Exclude<AppError, ParseError>
4949

5050
const isParseError = (error: AppError): error is ParseError =>
51-
error._tag === "UnknownCommand" ||
52-
error._tag === "UnknownOption" ||
53-
error._tag === "MissingOptionValue" ||
54-
error._tag === "MissingRequiredOption" ||
55-
error._tag === "InvalidOption" ||
56-
error._tag === "UnexpectedArgument"
51+
["UnknownCommand", "UnknownOption", "MissingOptionValue", "MissingRequiredOption", "InvalidOption", "UnexpectedArgument"].includes(error._tag)
5752

5853
const renderDockerAccessHeadline = (issue: DockerAccessError["issue"]): string =>
5954
issue === "PermissionDenied"

packages/app/src/lib/usecases/gitlab-token-preflight.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const mapGitlabRepoAccessStatus = (status: number): GitlabRepoAccessStatus => {
9393
if (status >= 200 && status < 300) {
9494
return "accessible"
9595
}
96-
if (status === 401 || status === 403 || status === 404) {
96+
if ([401, 403, 404].includes(status)) {
9797
return "notAccessible"
9898
}
9999
return "unknown"

packages/app/tests/docker-git/app-ready-create-fixture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export const expectEmptyRepoInlineError = (
292292
submitCreateInputsMock: SubmitCreateInputsMock,
293293
mode: CreateSubmitMode = "advance"
294294
) => {
295-
const createView = createInitialFlowView(" ")
295+
const createView = createInitialFlowView(" ".repeat(3))
296296
const { context, setCreateViewSpy } = runSubmitCreateView(submitCreateView, createView, { mode })
297297

298298
expect(submitCreateInputsMock).not.toHaveBeenCalled()

packages/app/tests/docker-git/controller-health.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const withHealthClient = <A, E>(
4848
revisions: ReadonlyArray<string>,
4949
effect: (baseUrl: string) => Effect.Effect<A, E, HttpClient.HttpClient>
5050
): Effect.Effect<A, E> =>
51-
effect("http://controller.test").pipe(Effect.provideService(HttpClient.HttpClient, makeHealthClient(revisions)))
51+
effect("https://controller.test").pipe(Effect.provideService(HttpClient.HttpClient, makeHealthClient(revisions)))
5252

5353
describe("controller health", () => {
5454
it.effect("selects the first reachable candidate whose revision matches the expected revision", () =>

packages/app/tests/docker-git/controller-ready.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ describe("controller readiness bootstrap", () => {
9898

9999
it.effect("probes explicit API URL before preparing a local controller revision", () =>
100100
Effect.gen(function*(_) {
101-
process.env["DOCKER_GIT_API_URL"] = "http://api.example.test"
101+
process.env["DOCKER_GIT_API_URL"] = "https://api.example.test"
102102
findReachableDirectHealthProbeMock.mockImplementation(({ explicitApiBaseUrl }) =>
103103
Effect.succeed({
104-
apiBaseUrl: explicitApiBaseUrl ?? "http://api.example.test",
104+
apiBaseUrl: explicitApiBaseUrl ?? "https://api.example.test",
105105
revision: "remote-revision"
106106
})
107107
)
@@ -116,7 +116,7 @@ describe("controller readiness bootstrap", () => {
116116
expect(prepareLocalControllerRevisionMock).not.toHaveBeenCalled()
117117
expect(prepareControllerResourceLimitEnvMock).not.toHaveBeenCalled()
118118
expect(prepareControllerRuntimeEnvMock).not.toHaveBeenCalled()
119-
expect(resolveApiBaseUrl()).toBe("http://api.example.test")
119+
expect(resolveApiBaseUrl()).toBe("https://api.example.test")
120120
}))
121121

122122
it.effect("falls back to local bootstrap when the default local API URL is not reachable", () =>

packages/app/tests/docker-git/controller-revision.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const createMemoryFileSystemLayer = () => {
141141
if (candidate === directory || !candidate.startsWith(prefix)) {
142142
continue
143143
}
144-
const name = candidate.slice(prefix.length).split("/")[0]
144+
const name = candidate.slice(prefix.length).split("/", 1)[0]
145145
if (name !== undefined && name.length > 0) {
146146
names.add(name)
147147
}

packages/app/tests/docker-git/menu-shared.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ const restoreTerminalBindings = (): void => {
4848
Object.defineProperty(process.stdout, "isTTY", { configurable: true, value: originalStdoutTty })
4949
}
5050

51-
const createRawModeStub = (events: Array<string>): typeof process.stdin.setRawMode =>
52-
(enabled: boolean) => {
53-
events.push(`raw:${String(enabled)}`)
54-
return process.stdin
55-
}
51+
const createRawModeStub = (events: Array<string>): typeof process.stdin.setRawMode => (enabled: boolean) => {
52+
events.push(`raw:${String(enabled)}`)
53+
return process.stdin
54+
}
5655

5756
const createWriteStub = (
5857
events: Array<string>

packages/app/tests/docker-git/terminal-session-client.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ describe("terminal-session-client", () => {
194194
vi.useFakeTimers()
195195
vi.resetModules()
196196
resolveApiBaseUrlMock.mockReset()
197-
resolveApiBaseUrlMock.mockReturnValue("http://controller.example/api")
197+
resolveApiBaseUrlMock.mockReturnValue("https://controller.example/api")
198198
writeToTerminalMock.mockReset()
199199
setRawModeMock.mockClear()
200200
stdinOnMock.mockClear()
@@ -247,7 +247,7 @@ describe("terminal-session-client", () => {
247247

248248
const socket = firstSocket()
249249
expect(socket.url).toBe(
250-
"ws://controller.example/api/projects/%2Fcontroller%2Fprovercoderai%2Fdocker-git%2Fmain/terminal-sessions/session-1/ws?cols=132&rows=40"
250+
"wss://controller.example/api/projects/%2Fcontroller%2Fprovercoderai%2Fdocker-git%2Fmain/terminal-sessions/session-1/ws?cols=132&rows=40"
251251
)
252252
expect(socket.sent).toEqual([])
253253
expect(setRawModeMock).toHaveBeenCalledWith(false)

0 commit comments

Comments
 (0)