From 00bd89e1d641f67360f6e8959363d0dcf0e4a456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20=F0=9F=94=B6=20Tarbert?= <66887028+NathanTarbert@users.noreply.github.com> Date: Fri, 21 Aug 2026 19:10:03 -0400 Subject: [PATCH] fix: fail the lint check on the warnings it reports (#75) biome exits 0 when it has only warnings to report, so ci.yml's static job ran the linter, printed its findings and passed. #63 is what that costs: an unused import biome flagged as a warning was a function recursing into its own default parameter, and the check went green over it. The script now passes --error-on-warnings. Clearing the 25 warnings standing on main to get there: - server/tests/skill-ownership.integration.test.ts had an unused eq import and a let that is never reassigned. Both fixed rather than suppressed. - Eight noTemplateCurlyInString are false positives in tests that assert on literal ${...} text, where an expanded template would break the test. Suppressed individually with that reason. - Fifteen noNonNullAssertion are all in tests, on fixtures the assertion above them has just proved exist. Scoped off for test files in biome.json rather than suppressed fifteen times; the rule still applies to everything else. Verified by mutation: an unused import in server/src, an unused import in a test, and a non-null assertion in server/src each fail the check now, so the override is narrower than the rule it scopes. --- agent-computer/tests/shell.test.ts | 1 + biome.json | 14 +++++++++++++- package.json | 2 +- server/tests/skill-ownership.integration.test.ts | 4 ++-- server/tests/tenant-package.test.ts | 6 ++++++ tests/compose.test.ts | 1 + 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/agent-computer/tests/shell.test.ts b/agent-computer/tests/shell.test.ts index f83c8322..048e4291 100644 --- a/agent-computer/tests/shell.test.ts +++ b/agent-computer/tests/shell.test.ts @@ -216,6 +216,7 @@ describe("the command that actually runs", () => { ); const result = await createShell(root, source()).run({ + // biome-ignore lint/suspicious/noTemplateCurlyInString: the literal `${...}` is the fixture — this asserts on unexpanded placeholder text, so a real template would break the test. command: 'echo "[${MARKER:-clean}]"', }); diff --git a/biome.json b/biome.json index e1c542f3..753a792c 100644 --- a/biome.json +++ b/biome.json @@ -21,5 +21,17 @@ "parser": { "tailwindDirectives": true } - } + }, + "overrides": [ + { + "includes": ["**/tests/**", "**/*.test.ts", "**/*.test.tsx"], + "linter": { + "rules": { + "style": { + "noNonNullAssertion": "off" + } + } + } + } + ] } diff --git a/package.json b/package.json index d202dbbf..451c99c9 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "generate:app-config": "bun --env-file=.env scripts/generate-app-config.ts", "format": "bunx biome format --write .", "format:check": "bunx biome format .", - "lint": "bunx biome lint .", + "lint": "bunx biome lint --error-on-warnings .", "test": "bun test", "typecheck": "bun run --filter '*' typecheck", "test:ci": "bun scripts/test-ci.ts", diff --git a/server/tests/skill-ownership.integration.test.ts b/server/tests/skill-ownership.integration.test.ts index cdb44a40..770f7d80 100644 --- a/server/tests/skill-ownership.integration.test.ts +++ b/server/tests/skill-ownership.integration.test.ts @@ -1,6 +1,6 @@ import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { randomUUID } from "node:crypto"; -import { eq, inArray } from "drizzle-orm"; +import { inArray } from "drizzle-orm"; import { createAuditStore } from "../src/audit"; import type { ActionPolicy } from "../src/computer/policy"; import { createDatabase } from "../src/db/client"; @@ -24,7 +24,7 @@ const database = createDatabase( TEST_POOL, ); -let policy: ActionPolicy = { mode: "enforce", deny: [], allow: ["true"] }; +const policy: ActionPolicy = { mode: "enforce", deny: [], allow: ["true"] }; const store = createPluginStore({ database, diff --git a/server/tests/tenant-package.test.ts b/server/tests/tenant-package.test.ts index 5e1dc3c8..911e9684 100644 --- a/server/tests/tenant-package.test.ts +++ b/server/tests/tenant-package.test.ts @@ -606,6 +606,7 @@ describe("expanding a package file against the environment", () => { test("takes the value from the environment", () => { expect( + // biome-ignore lint/suspicious/noTemplateCurlyInString: the literal `${...}` is the fixture — this asserts on unexpanded placeholder text, so a real template would break the test. expandEnvironment("endpoint: ${AG_UI_URL}", file, { AG_UI_URL: "https://bots.example.test/ag-ui", }), @@ -615,6 +616,7 @@ describe("expanding a package file against the environment", () => { test("falls back to the default when the name is not set", () => { expect( expandEnvironment( + // biome-ignore lint/suspicious/noTemplateCurlyInString: the literal `${...}` is the fixture — this asserts on unexpanded placeholder text, so a real template would break the test. "endpoint: ${AG_UI_URL:-http://localhost:4200}", file, {}, @@ -624,6 +626,7 @@ describe("expanding a package file against the environment", () => { test("prefers the environment over the default", () => { expect( + // biome-ignore lint/suspicious/noTemplateCurlyInString: the literal `${...}` is the fixture — this asserts on unexpanded placeholder text, so a real template would break the test. expandEnvironment("endpoint: ${AG_UI_URL:-http://localhost:4200}", file, { AG_UI_URL: "https://bots.example.test", }), @@ -632,6 +635,7 @@ describe("expanding a package file against the environment", () => { test("treats an empty value as unset", () => { expect( + // biome-ignore lint/suspicious/noTemplateCurlyInString: the literal `${...}` is the fixture — this asserts on unexpanded placeholder text, so a real template would break the test. expandEnvironment("endpoint: ${AG_UI_URL:-http://localhost:4200}", file, { AG_UI_URL: "", }), @@ -639,12 +643,14 @@ describe("expanding a package file against the environment", () => { }); test("an empty default is allowed and is not an error", () => { + // biome-ignore lint/suspicious/noTemplateCurlyInString: the literal `${...}` is the fixture — this asserts on unexpanded placeholder text, so a real template would break the test. expect(expandEnvironment("suffix: ${NOTHING:-}", file, {})).toBe( "suffix: ", ); }); test("refuses a name with neither a value nor a default", () => { + // biome-ignore lint/suspicious/noTemplateCurlyInString: the literal `${...}` is the fixture — this asserts on unexpanded placeholder text, so a real template would break the test. expect(() => expandEnvironment("endpoint: ${AG_UI_URL}", file, {})).toThrow( /agents\.yaml refers to \$\{AG_UI_URL\}/, ); diff --git a/tests/compose.test.ts b/tests/compose.test.ts index ce020334..c80b6eba 100644 --- a/tests/compose.test.ts +++ b/tests/compose.test.ts @@ -10,6 +10,7 @@ test("provides PostgreSQL with pgvector for local development", () => { expect(compose).toContain("postgres:"); expect(compose).toContain("pgvector/pgvector:"); + // biome-ignore lint/suspicious/noTemplateCurlyInString: the literal `${...}` is the fixture — this asserts on unexpanded placeholder text, so a real template would break the test. expect(compose).toContain("${POSTGRES_PORT:-5432}:5432"); });