Skip to content

[refactor] idd-list PR body parsing: ignore #N inside fenced code blocks (sister concern from #13) #14

@kiki830621

Description

@kiki830621

Problem

idd-list v2.51.0+ 將實作 PR body parsing 偵測 #N references。第一版接受 false positive(#13 R1 risk acknowledged):fenced code block 內的 #N 也會被當成 issue ref

例:PR body 含

# Example: how to reference an issue
git commit -m "Refs #99"

#99 出現在 code block 內,不是真正的 ref,但會被 #([0-9]+)� regex 命中。

Type

refactor / observability quality

Why P3

  • 不影響 happy path:大多數 PR body 不會在 code block 內列 issue refs
  • false positive 結果:idd-list 顯示「issue #99 has open PR #N」是錯的,但 user 一查就知道
  • 修起來簡單但邊界 case 多(nested fences、indented blocks、tilde fences),完整修需測試

Recommendation

實作 markdown-aware parser:strip fenced code blocks(\``...```+~~~...~~~` + 4-space indent blocks)before regex scan。

Source

surfaced during /idd-diagnose #13 sister concern surfacing (Step 3.6) — referenced as risk R1

Current Status

Phase: closed
Last updated: 2026-05-07 by idd-close

Resolution

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions