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
8 changes: 7 additions & 1 deletion cpp_linter/clang_tools/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ def __init__(self, file_name: str) -> None:
def serialize_to_github_payload(self) -> Dict[str, Any]:
"""Serialize this object into a JSON compatible with Github's REST API."""
assert self.line_end > 0, "ending line number unknown"
result = {"path": self.file_name, "body": self.comment, "line": self.line_end}
from ..rest_api import COMMENT_MARKER # workaround circular import

result = {
"path": self.file_name,
"body": f"{COMMENT_MARKER}{self.comment}",
"line": self.line_end,
}
if self.line_start != self.line_end and self.line_start > 0:
result["start_line"] = self.line_start
return result
Expand Down