(path: Path, raw_target: str, line_no: int)
| 144 | |
| 145 | |
| 146 | def check_target(path: Path, raw_target: str, line_no: int) -> list[str]: |
| 147 | target = normalize_target(raw_target) |
| 148 | if not target or not is_local_target(raw_target): |
| 149 | return [] |
| 150 | target_path = (path.parent / target).resolve() |
| 151 | try: |
| 152 | target_path.relative_to(ROOT) |
| 153 | except ValueError: |
| 154 | return [] |
| 155 | if target_path.exists(): |
| 156 | return [] |
| 157 | return [ |
| 158 | f"{path.relative_to(ROOT)}:{line_no}: missing local link target: {raw_target}" |
| 159 | ] |
| 160 | |
| 161 | |
| 162 | def check_links(path: Path, text: str) -> list[str]: |
no test coverage detected