(
article_path: Path,
text: str,
*,
staged: bool,
args: argparse.Namespace,
root: Path,
)
| 367 | |
| 368 | |
| 369 | def check_images( |
| 370 | article_path: Path, |
| 371 | text: str, |
| 372 | *, |
| 373 | staged: bool, |
| 374 | args: argparse.Namespace, |
| 375 | root: Path, |
| 376 | ) -> tuple[int, tuple[ImageIssue, ...]]: |
| 377 | refs = find_image_refs(text) |
| 378 | issues = [ |
| 379 | ImageIssue(line=ref.line, target=ref.target, issue=issue) |
| 380 | for ref in refs |
| 381 | if (issue := image_issue(article_path, ref, staged=staged, args=args, root=root)) |
| 382 | ] |
| 383 | return len(refs), tuple(issues) |
| 384 | |
| 385 | |
| 386 | def read_path(path: Path, *, staged: bool) -> str: |
no test coverage detected