Skip to content
Merged
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: 2 additions & 0 deletions tests/test_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ def test_post_review_counts_only_lf_as_patch_line_break(gh: FakeGh, separator: s
findings = (
Finding("important", path, 2, "In diff", ""),
Finding("critical", path, 3, "Outside diff", ""),
Finding("suggestion", path, 3, "Off-diff suggestion", ""),
)

github.post_review(REPO, 7, HEAD, review(findings=findings))
Expand All @@ -481,6 +482,7 @@ def test_post_review_counts_only_lf_as_patch_line_break(gh: FakeGh, separator: s
comments = comments_posted(gh)
assert [(c["path"], c["line"]) for c in comments] == [(path, 2), (path, 1)]
assert "Reviewer location src/a.py:3 is not in the diff" in comments[1]["body"]
assert "Off-diff suggestion" in review_payloads(gh)[0]["body"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: The no-inline-comment check depends on the exact comment list

The test proves that the suggestion is not posted inline only because of the existing exact-list check on line 483 ([(path, 2), (path, 1)]). The test still catches the regression today: if a non-blocking off-diff finding were anchored, review_payloads in src/loopzero/github.py:943-954 would add a third entry. But that link is easy to miss, and a later edit that loosens line 483 would silently drop the proof the task asks for. Optionally make it explicit with an assertion such as assert all("Off-diff suggestion" not in c["body"] for c in comments). This is non-blocking.



@pytest.mark.parametrize(("files", "severity", "anchor"), [
Expand Down
Loading