From 1d1e355f0bb9770ee7e02ad4c7c3b3944fe8b87a Mon Sep 17 00:00:00 2001 From: KeKs0r Date: Thu, 23 Apr 2026 10:28:13 +0200 Subject: [PATCH 1/2] configure fallow analysis --- .fallowrc.json | 18 ++++++++++++++++ .github/workflows/ci.yml | 10 +++++++++ fallow-plugin-chkit-conventions.jsonc | 23 +++++++++++++++++++++ package.json | 4 ++++ packages/cli/src/bin/clickhouse-resource.ts | 14 ------------- src/db/schema/example.ts | 17 --------------- 6 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 .fallowrc.json create mode 100644 fallow-plugin-chkit-conventions.jsonc delete mode 100644 packages/cli/src/bin/clickhouse-resource.ts delete mode 100644 src/db/schema/example.ts diff --git a/.fallowrc.json b/.fallowrc.json new file mode 100644 index 0000000..3b239a9 --- /dev/null +++ b/.fallowrc.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json", + "duplicates": { + "ignore": [ + "packages/**/*.test.ts", + "packages/**/*.spec.ts", + "packages/**/*.e2e.test.ts" + ], + "ignoreImports": true + }, + "health": { + "ignore": [ + "packages/**/*.test.ts", + "packages/**/*.spec.ts", + "packages/**/*.e2e.test.ts" + ] + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f63a140..576a0c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,16 @@ jobs: - name: Verify lockfile unchanged run: git diff --exit-code bun.lock + - name: Fallow analysis + uses: fallow-rs/fallow@v2 + with: + format: sarif + + - name: Upload Fallow SARIF + uses: github/codeql-action/upload-sarif@v4 + with: + sarif_file: fallow-results.sarif + - name: Verify env: TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} diff --git a/fallow-plugin-chkit-conventions.jsonc b/fallow-plugin-chkit-conventions.jsonc new file mode 100644 index 0000000..f0c217a --- /dev/null +++ b/fallow-plugin-chkit-conventions.jsonc @@ -0,0 +1,23 @@ +{ + "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/plugin-schema.json", + "name": "chkit-conventions", + "detection": { "type": "fileExists", "pattern": "bun.lock" }, + "entryPointRole": "test", + "entryPoints": [ + "packages/**/*.test.ts", + "packages/**/*.spec.ts", + "packages/**/*.e2e.test.ts" + ], + "alwaysUsed": [ + "apps/docs/functions/**/*.ts", + "apps/docs/src/styles/custom.css", + "packages/cli/src/e2e-testkit.ts" + ], + "configPatterns": [ + "apps/docs/astro.config.mjs", + "apps/docs/wrangler.jsonc", + "biome.json", + "turbo.json" + ], + "toolingDependencies": ["sharp", "wrangler"] +} diff --git a/package.json b/package.json index d51b17f..62e4a8b 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,10 @@ "test": "turbo run test", "test:turbo": "turbo run test", "test:env": "doppler run --project chkit --config ci -- bun run test", + "fallow": "bunx fallow", + "fallow:dead-code": "bunx fallow --only dead-code", + "fallow:pr": "bunx fallow --changed-since main --summary || true", + "fallow:ci": "bunx fallow --fail-on-issues", "verify": "doppler run --project chkit --config ci -- turbo run typecheck lint test build", "changeset": "changeset", "version-packages": "changeset version", diff --git a/packages/cli/src/bin/clickhouse-resource.ts b/packages/cli/src/bin/clickhouse-resource.ts deleted file mode 100644 index 476e8ab..0000000 --- a/packages/cli/src/bin/clickhouse-resource.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { createClickHouseExecutor, type ClickHouseExecutor } from '@chkit/clickhouse' -import type { ChxConfig } from '@chkit/core' - -export async function withClickHouseExecutor( - clickhouseConfig: NonNullable, - run: (db: ClickHouseExecutor) => Promise -): Promise { - const db = createClickHouseExecutor(clickhouseConfig) - try { - return await run(db) - } finally { - await db.close() - } -} diff --git a/src/db/schema/example.ts b/src/db/schema/example.ts deleted file mode 100644 index 31ec209..0000000 --- a/src/db/schema/example.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { schema, table } from '@chkit/core' - -const events = table({ - database: 'default', - name: 'events', - engine: 'MergeTree', - columns: [ - { name: 'id', type: 'UInt64' }, - { name: 'source', type: 'String' }, - { name: 'ingested_at', type: 'DateTime64(3)', default: 'fn:now64(3)' }, - ], - primaryKey: ['id'], - orderBy: ['id'], - partitionBy: 'toYYYYMM(ingested_at)', -}) - -export default schema(events) From 5db1d1fdbc6f7c4147d391af2bdefa3616763dce Mon Sep 17 00:00:00 2001 From: KeKs0r Date: Thu, 23 Apr 2026 11:40:59 +0200 Subject: [PATCH 2/2] make fallow CI advisory --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 576a0c9..0e16c45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ jobs: uses: fallow-rs/fallow@v2 with: format: sarif + fail-on-issues: false - name: Upload Fallow SARIF uses: github/codeql-action/upload-sarif@v4