coverage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCoverage Check
覆盖率检查
Context
背景
Run in parallel:
- - get unstaged files
git diff --name-only - - get changed line numbers
git diff -U0 --no-color
并行执行:
- - 获取未暂存文件
git diff --name-only - - 获取变更行号
git diff -U0 --no-color
Commands
命令
Sequential:
- - vitest with coverage
npm run test:ci - - generate lcov/text reports
npm run coverage:report
按顺序执行:
- - 带覆盖率统计的vitest
npm run test:ci - - 生成lcov/文本格式报告
npm run coverage:report
Workflow
工作流程
- Get unstaged files and line ranges (parallel):
git diff --name-onlygit diff -U0 --no-color
- Run coverage:
npm run test:cinpm run coverage:report
- Parse (see
coverage/lcov.infofor format details)lcov-format.md - Map changed lines to coverage data
- Report uncovered lines:
file.ts:42 - Summary: X/Y changed lines covered
- 获取未暂存文件和行范围(并行执行):
git diff --name-onlygit diff -U0 --no-color
- 运行覆盖率统计:
npm run test:cinpm run coverage:report
- 解析(格式细节参考
coverage/lcov.info)lcov-format.md - 将变更行映射到覆盖率数据
- 报告未覆盖的行:
file.ts:42 - 汇总:X/Y行变更已覆盖
Rules
规则
- Only analyze unstaged changes ()
git diff - Use sequential commands: then
test:cicoverage:report - Parse lcov.info for coverage data
- Report uncovered lines:
file.ts:42 - Ignore files without coverage data (non-code files)
- 仅分析未暂存变更()
git diff - 使用顺序命令:先再
test:cicoverage:report - 解析lcov.info获取覆盖率数据
- 报告未覆盖的行:
file.ts:42 - 忽略无覆盖率数据的文件(非代码文件)