Skip to content

Commit 6764fef

Browse files
anandgupta42claude
andcommitted
style: format dbt-cli.test.ts and publish.ts with Prettier
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 66c7e6c commit 6764fef

2 files changed

Lines changed: 15 additions & 44 deletions

File tree

packages/dbt-tools/test/dbt-cli.test.ts

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ mock.module("child_process", () => ({
1414
}))
1515

1616
// Import after mocking
17-
const { execDbtShow, execDbtCompile, execDbtCompileInline, execDbtLs } = await import(
18-
"../src/dbt-cli"
19-
)
17+
const { execDbtShow, execDbtCompile, execDbtCompileInline, execDbtLs } = await import("../src/dbt-cli")
2018

2119
// ---------------------------------------------------------------------------
2220
// execDbtShow
@@ -46,9 +44,7 @@ describe("execDbtShow", () => {
4644
})
4745

4846
test("Tier 1: parses data.rows (alternative format)", async () => {
49-
const jsonLines = [
50-
JSON.stringify({ data: { rows: [{ name: "Alice" }, { name: "Bob" }] } }),
51-
].join("\n")
47+
const jsonLines = [JSON.stringify({ data: { rows: [{ name: "Alice" }, { name: "Bob" }] } })].join("\n")
5248

5349
mockExecFile.mockImplementation((_cmd: string, _args: string[], _opts: any, cb: Function) => {
5450
cb(null, jsonLines, "")
@@ -60,9 +56,7 @@ describe("execDbtShow", () => {
6056
})
6157

6258
test("Tier 1: parses result.preview (hypothetical future format)", async () => {
63-
const jsonLines = [
64-
JSON.stringify({ result: { preview: [{ id: 42 }], sql: "SELECT 42" } }),
65-
].join("\n")
59+
const jsonLines = [JSON.stringify({ result: { preview: [{ id: 42 }], sql: "SELECT 42" } })].join("\n")
6660

6761
mockExecFile.mockImplementation((_cmd: string, _args: string[], _opts: any, cb: Function) => {
6862
cb(null, jsonLines, "")
@@ -136,16 +130,7 @@ describe("execDbtShow", () => {
136130
cb(null, JSON.stringify({ info: { msg: "done" } }), "")
137131
} else {
138132
// Plain text ASCII table
139-
cb(
140-
null,
141-
[
142-
"| id | name |",
143-
"| -- | ----- |",
144-
"| 1 | Alice |",
145-
"| 2 | Bob |",
146-
].join("\n"),
147-
"",
148-
)
133+
cb(null, ["| id | name |", "| -- | ----- |", "| 1 | Alice |", "| 2 | Bob |"].join("\n"), "")
149134
}
150135
})
151136

@@ -189,9 +174,7 @@ describe("execDbtCompile", () => {
189174
})
190175

191176
test("Tier 1: parses data.compiled_code (newer dbt)", async () => {
192-
const jsonLines = [
193-
JSON.stringify({ data: { compiled_code: "SELECT * FROM stg_orders" } }),
194-
].join("\n")
177+
const jsonLines = [JSON.stringify({ data: { compiled_code: "SELECT * FROM stg_orders" } })].join("\n")
195178

196179
mockExecFile.mockImplementation((_cmd: string, _args: string[], _opts: any, cb: Function) => {
197180
cb(null, jsonLines, "")
@@ -202,9 +185,7 @@ describe("execDbtCompile", () => {
202185
})
203186

204187
test("Tier 1: parses result.node.compiled_code", async () => {
205-
const jsonLines = [
206-
JSON.stringify({ result: { node: { compiled_code: "SELECT 1" } } }),
207-
].join("\n")
188+
const jsonLines = [JSON.stringify({ result: { node: { compiled_code: "SELECT 1" } } })].join("\n")
208189

209190
mockExecFile.mockImplementation((_cmd: string, _args: string[], _opts: any, cb: Function) => {
210191
cb(null, jsonLines, "")
@@ -215,9 +196,7 @@ describe("execDbtCompile", () => {
215196
})
216197

217198
test("Tier 1: parses data.compiled_sql", async () => {
218-
const jsonLines = [
219-
JSON.stringify({ data: { compiled_sql: "SELECT 1 FROM foo" } }),
220-
].join("\n")
199+
const jsonLines = [JSON.stringify({ data: { compiled_sql: "SELECT 1 FROM foo" } })].join("\n")
221200

222201
mockExecFile.mockImplementation((_cmd: string, _args: string[], _opts: any, cb: Function) => {
223202
cb(null, jsonLines, "")
@@ -273,9 +252,7 @@ describe("execDbtCompileInline", () => {
273252
})
274253

275254
test("compiles inline SQL", async () => {
276-
const jsonLines = [
277-
JSON.stringify({ data: { compiled: "SELECT id, name FROM raw.customers" } }),
278-
].join("\n")
255+
const jsonLines = [JSON.stringify({ data: { compiled: "SELECT id, name FROM raw.customers" } })].join("\n")
279256

280257
mockExecFile.mockImplementation((_cmd: string, _args: string[], _opts: any, cb: Function) => {
281258
cb(null, jsonLines, "")
@@ -339,11 +316,7 @@ describe("execDbtLs", () => {
339316
cb(new Error("--output json not supported"), "", "")
340317
} else {
341318
// Plain text: one unique_id per line
342-
cb(
343-
null,
344-
"model.jaffle.stg_orders\nmodel.jaffle.stg_payments\nmodel.jaffle.orders\n",
345-
"",
346-
)
319+
cb(null, "model.jaffle.stg_orders\nmodel.jaffle.stg_payments\nmodel.jaffle.orders\n", "")
347320
}
348321
})
349322

packages/opencode/script/publish.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ const runtimeDependencies: Record<string, string> = {
2121
}
2222

2323
const driverPeerDependencies: Record<string, string> = {
24-
"pg": ">=8",
24+
pg: ">=8",
2525
"snowflake-sdk": ">=1",
2626
"@google-cloud/bigquery": ">=8",
2727
"@databricks/sql": ">=1",
28-
"mysql2": ">=3",
29-
"mssql": ">=11",
30-
"oracledb": ">=6",
31-
"duckdb": ">=1",
28+
mysql2: ">=3",
29+
mssql: ">=11",
30+
oracledb: ">=6",
31+
duckdb: ">=1",
3232
}
3333

3434
const driverPeerDependenciesMeta: Record<string, { optional: true }> = Object.fromEntries(
@@ -72,9 +72,7 @@ async function copyAssets(targetDir: string) {
7272
// dist/index.js as ESM instead of CJS. We synthesize a minimal one rather
7373
// than copying the full source package.json (which contains devDependencies
7474
// with Bun catalog: versions that would confuse vulnerability scanners).
75-
await Bun.file(`${targetDir}/dbt-tools/package.json`).write(
76-
JSON.stringify({ type: "module" }, null, 2) + "\n",
77-
)
75+
await Bun.file(`${targetDir}/dbt-tools/package.json`).write(JSON.stringify({ type: "module" }, null, 2) + "\n")
7876
if (fs.existsSync("../dbt-tools/dist/altimate_python_packages")) {
7977
await $`cp -r ../dbt-tools/dist/altimate_python_packages ${targetDir}/dbt-tools/dist/`
8078
}

0 commit comments

Comments
 (0)