Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/issue_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _task_has_concrete_target(item: str) -> bool:
_NODE_SUFFIX = re.compile(r"::.+$") # pytest node ids: tests/x.py::test_y
_ORIGINAL_ISSUE_BLOCK_RE = re.compile(
r"<details\b[^>]*>\s*<summary>Original Issue</summary>\s*"
r"(?P<fence>`{3,})text\s*\n(?P<inner>.*?)\n(?P=fence)\s*</details>",
r"(?P<fence>`{3,}|~{3,})text\s*\n(?P<inner>.*?)\n(?P=fence)\s*</details>",
re.DOTALL | re.IGNORECASE,
)
# Self-referential boilerplate. The format contract tells authors to cite it, so
Expand Down
2 changes: 1 addition & 1 deletion templates/consumer-repo/.github/scripts/issue_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _task_has_concrete_target(item: str) -> bool:
_NODE_SUFFIX = re.compile(r"::.+$") # pytest node ids: tests/x.py::test_y
_ORIGINAL_ISSUE_BLOCK_RE = re.compile(
r"<details\b[^>]*>\s*<summary>Original Issue</summary>\s*"
r"(?P<fence>`{3,})text\s*\n(?P<inner>.*?)\n(?P=fence)\s*</details>",
r"(?P<fence>`{3,}|~{3,})text\s*\n(?P<inner>.*?)\n(?P=fence)\s*</details>",
re.DOTALL | re.IGNORECASE,
)
# Self-referential boilerplate. The format contract tells authors to cite it, so
Expand Down
7 changes: 4 additions & 3 deletions tests/scripts/test_issue_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ def test_fenced_headings_do_not_satisfy_required_sections() -> None:
Path("templates/consumer-repo/.github/scripts/issue_format.py"),
],
)
@pytest.mark.parametrize("fence", ["```", "~~~"])
def test_archived_original_issue_paths_do_not_poison_live_addressability(
validator_path: Path, tmp_path: Path
validator_path: Path, fence: str, tmp_path: Path
) -> None:
validator = _validator(validator_path)
(tmp_path / "src").mkdir()
Expand All @@ -47,9 +48,9 @@ def test_archived_original_issue_paths_do_not_poison_live_addressability(
VALID_CONTEXT
+ "## Tasks\n- [ ] Update function `calculateDiscount`\n\n"
+ "## Acceptance Criteria\n- pytest tests/test_current.py passes\n\n"
+ "<details>\n<summary>Original Issue</summary>\n\n```text\n"
+ f"<details>\n<summary>Original Issue</summary>\n\n{fence}text\n"
+ "Old evidence: `missing/one.py`, `missing/two.py`, `missing/three.py`.\n"
+ "<details>literal archived markup</details>\n```\n</details>\n"
+ f"<details>literal archived markup</details>\n{fence}\n</details>\n"
)

report = validator.validate(body, repo_root=tmp_path)
Expand Down
Loading