Skip to content

fix(cli): clarify empty file discovery output - #152

Merged
luojiyin1987 merged 3 commits into
masterfrom
fix/clarify-empty-discovery-output
Aug 22, 2026
Merged

fix(cli): clarify empty file discovery output#152
luojiyin1987 merged 3 commits into
masterfrom
fix/clarify-empty-discovery-output

Conversation

@luojiyin1987

Copy link
Copy Markdown
Contributor

Closes #151

改动

不改变退出码,把 "为什么没有 lint 到文件" 说清楚。区分两种情况:

glob / 扩展名过滤后没有匹配(带输入 pattern,直接暴露拼错的 glob):

[lint-md] No Markdown files matched: "docs/**/*.markdwon"

--max-file-size 把所有文件都跳过了

[lint-md] No Markdown files remain after file-size filtering.

细节:

  • 两种消息都走 stderr,stdout 保持只输出报告;pattern 文本经 sanitizeTerminalText 清理
  • exit code 保持 0,本地使用与 CI 行为完全兼容

测试

  • run-file-lint.spec.ts:未匹配 → 断言新消息 + pattern + exit 0;size filter 清空 → 断言独立消息且不再进入并发/batch 阶段
  • max-file-size.spec.ts:e2e 用例改为断言新的 size-filter 消息;顺带修复 runCli helper 只在失败路径捕获 stderr 的问题(改用 spawnSync

验证:typecheck 通过、prettier 通过、全量测试 25 suites / 204 tests 通过。

@luojiyin1987
luojiyin1987 merged commit fb2795c into master Aug 22, 2026
6 checks passed
@luojiyin1987
luojiyin1987 deleted the fix/clarify-empty-discovery-output branch August 22, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve(cli): clarify empty file discovery output

1 participant