Yield every first-party `.md` file under `targets`, deduplicated and sorted. Vendored `lib/` trees, build output, and `LICENSE*.md` are skipped (see `_is_skipped`) even when a target points straight at them.
(targets: list[Path])
| 697 | |
| 698 | |
| 699 | def iter_markdown_files(targets: list[Path]) -> Iterable[Path]: |
| 700 | """Yield every first-party `.md` file under `targets`, deduplicated and |
| 701 | sorted. Vendored `lib/` trees, build output, and `LICENSE*.md` are |
| 702 | skipped (see `_is_skipped`) even when a target points straight at them.""" |
| 703 | seen: set[Path] = set() |
| 704 | for t in targets: |
| 705 | if t.is_file(): |
| 706 | if t.suffix.lower() == ".md" and not _is_skipped(t): |
| 707 | seen.add(t.resolve()) |
| 708 | elif t.is_dir(): |
| 709 | for root, _, files in os.walk(t): |
| 710 | root_path = Path(root) |
| 711 | if any(p in _SKIP_DIRS for p in root_path.parts): |
| 712 | continue |
| 713 | for name in files: |
| 714 | if not name.lower().endswith(".md"): |
| 715 | continue |
| 716 | p = root_path / name |
| 717 | if not _is_skipped(p): |
| 718 | seen.add(p.resolve()) |
| 719 | return sorted(seen) |
| 720 | |
| 721 | |
| 722 | # --------------------------------------------------------------------------- |
no test coverage detected