summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--packages/opencode/src/file/ripgrep.ts6
-rw-r--r--packages/opencode/src/tool/glob.ts6
-rw-r--r--packages/opencode/test/file/ripgrep.test.ts10
3 files changed, 16 insertions, 6 deletions
diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.ts
index 8a2d9407a..4f02c97b1 100644
--- a/packages/opencode/src/file/ripgrep.ts
+++ b/packages/opencode/src/file/ripgrep.ts
@@ -328,9 +328,9 @@ export namespace Ripgrep {
}
}
- return spawner.streamLines(
- ChildProcess.make(args[0], args.slice(1), { cwd: input.cwd }),
- ).pipe(Stream.filter((line: string) => line.length > 0))
+ return spawner
+ .streamLines(ChildProcess.make(args[0], args.slice(1), { cwd: input.cwd }))
+ .pipe(Stream.filter((line: string) => line.length > 0))
})
return Service.of({
diff --git a/packages/opencode/src/tool/glob.ts b/packages/opencode/src/tool/glob.ts
index 180e20f60..973f14699 100644
--- a/packages/opencode/src/tool/glob.ts
+++ b/packages/opencode/src/tool/glob.ts
@@ -51,7 +51,11 @@ export const GlobTool = Tool.defineEffect(
Effect.gen(function* () {
const full = path.resolve(search, file)
const info = yield* fs.stat(full).pipe(Effect.catch(() => Effect.succeed(undefined)))
- const mtime = info?.mtime.pipe(Option.map((d) => d.getTime()), Option.getOrElse(() => 0)) ?? 0
+ const mtime =
+ info?.mtime.pipe(
+ Option.map((d) => d.getTime()),
+ Option.getOrElse(() => 0),
+ ) ?? 0
return { path: full, mtime }
}),
),
diff --git a/packages/opencode/test/file/ripgrep.test.ts b/packages/opencode/test/file/ripgrep.test.ts
index 03c529f18..3982c184f 100644
--- a/packages/opencode/test/file/ripgrep.test.ts
+++ b/packages/opencode/test/file/ripgrep.test.ts
@@ -66,7 +66,10 @@ describe("Ripgrep.Service", () => {
const files = await Effect.gen(function* () {
const rg = yield* Ripgrep.Service
- return yield* rg.files({ cwd: tmp.path }).pipe(Stream.runCollect, Effect.map((chunk) => [...chunk].sort()))
+ return yield* rg.files({ cwd: tmp.path }).pipe(
+ Stream.runCollect,
+ Effect.map((chunk) => [...chunk].sort()),
+ )
}).pipe(Effect.provide(Ripgrep.defaultLayer), Effect.runPromise)
expect(files).toEqual(["a.txt", "b.txt"])
@@ -82,7 +85,10 @@ describe("Ripgrep.Service", () => {
const files = await Effect.gen(function* () {
const rg = yield* Ripgrep.Service
- return yield* rg.files({ cwd: tmp.path, glob: ["*.ts"] }).pipe(Stream.runCollect, Effect.map((chunk) => [...chunk]))
+ return yield* rg.files({ cwd: tmp.path, glob: ["*.ts"] }).pipe(
+ Stream.runCollect,
+ Effect.map((chunk) => [...chunk]),
+ )
}).pipe(Effect.provide(Ripgrep.defaultLayer), Effect.runPromise)
expect(files).toEqual(["keep.ts"])