From d22ac5f0e4d00ecab46133990a7f6fb6b3bd43dd Mon Sep 17 00:00:00 2001 From: ssw Date: Sun, 14 Jun 2026 20:28:27 +0800 Subject: [PATCH] fix(dacli): form-lint dead import + unused interface (Batch A review fix) --- src/commands/form/_blindspots.ts | 5 ----- src/commands/form/lint.ts | 11 +++++++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/commands/form/_blindspots.ts b/src/commands/form/_blindspots.ts index e5c5aed..1173882 100644 --- a/src/commands/form/_blindspots.ts +++ b/src/commands/form/_blindspots.ts @@ -14,11 +14,6 @@ export interface BlindspotIssue { message: string } -export interface BlindspotResult { - issues: BlindspotIssue[] - blindspotIds: string[] // e.g. ['BS-23', 'BS-31', ...] — 5 必查 ID 列表 -} - export const BLINDSPOT_IDS = ['BS-23', 'BS-31', 'BS-32', 'BS-15', 'BS-V2'] as const function safeParse(s: unknown): unknown { diff --git a/src/commands/form/lint.ts b/src/commands/form/lint.ts index 0a2a563..528f994 100644 --- a/src/commands/form/lint.ts +++ b/src/commands/form/lint.ts @@ -12,7 +12,7 @@ import { Command } from 'commander' import { readFileSync } from 'node:fs' import { resolve } from 'node:path' import { installAiHelpHook } from '../../core/help.ts' -import { checkBs31, checkBs32, checkBs23, type BlindspotIssue } from './_blindspots.ts' +import { checkBs31, checkBs32, type BlindspotIssue } from './_blindspots.ts' import { parsePythonForms, parseDesignHtml, type FormDef, type CmdBlock } from './_parsers.ts' import { printJson, log } from '../../core/log.ts' @@ -44,6 +44,8 @@ function lintScript(scriptPath: string): { forms: FormDef[]; issues: BlindspotIs issues.push(...checkBs31(JSON.stringify(formData))) issues.push(...checkBs32(JSON.stringify(formData))) } + // BS-23/15/V2 设计期跳过: 需 JNPF server 拉 form 详情 (columnData/tables/formData JSON), + // 设计稿/Python 脚本无运行时 form data, 由 form validate 运行时兜底 return { forms, issues } } @@ -145,9 +147,10 @@ export function buildFormLintCommand(): Command { 'dacli form lint --from-script=... --from-design=...', ], notes: [ - 'BS-23 检查 design 整体是否含 4 个 use*Permission (粗略扫描)', - 'BS-31/32 检查每个 form 字段 label / decimal 类型', - 'BS-15/V2 在设计期无法直接判断, 标 N/A (运行时由 form validate 兜底)', + 'BS-23 N/A 设计期: 需运行时 columnData, 由 form validate 兜底', + 'BS-31/32 per-field 检查: 扫每个 form 字段 label / decimal 类型', + 'BS-15 N/A 设计期: 需运行时 tables (enableFlow=1 + f_flow_task_id)', + 'BS-V2 N/A 设计期: 需运行时 form detail (formData/columnData/dbLinkId)', ], })