Skip to content

[codex] fix cobertura source roots - #4

Merged
tooooolong merged 1 commit into
mainfrom
codex/fix-cobertura-source-roots
Apr 3, 2026
Merged

tooooolong merged 1 commit into
mainfrom
codex/fix-cobertura-source-roots

Conversation

@tooooolong

Copy link
Copy Markdown
Owner

PR 背景

  • 当前 Cobertura reporter 会把 <sources> 硬编码成 src
  • 当下游项目的 source root 不是 src,例如 src/main/clojure,消费者会把 filename 和错误的 source root 拼接,导致 diff-cover 等工具无法匹配覆盖率。

PR 改了什么

  • reporter 现在优先从 cloverage 传入的 :args :src-ns-path 生成 <sources>
  • 支持输出多个 source root,并保留 filename 为相对 source root 的路径。
  • :src-ns-path 缺失时,继续回退到 src,保持现有 demo 行为。
  • 新增回归测试,覆盖 src/main/clojure 和多 source root 场景。
  • .cpcache/ 加入 .gitignore,避免本地缓存污染工作区。
  • 更新 :test alias,让新的 reporter 测试进入默认测试流程。

都做了哪些测试

  • clj -M:test

@tooooolong
tooooolong marked this pull request as ready for review April 3, 2026 14:32
@tooooolong
tooooolong merged commit ca9a71e into main Apr 3, 2026
18 checks passed
@tooooolong
tooooolong deleted the codex/fix-cobertura-source-roots branch April 3, 2026 14:34
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.

1 participant