Documentation
¶
Overview ¶
Package marker renders and parses codereview PR comment markers.
Index ¶
Constants ¶
const ( ActionKindInlineComment = "inline_comment" ActionKindThreadReply = "thread_reply" ActionKindRollupComment = "rollup_comment" ActionKindSubmitReview = "submit_review" )
Action marker kind values.
const ( RollupOutcomeApproved = "approved" RollupOutcomeRequestChanges = "request_changes" RollupOutcomeComment = "comment" RollupOutcomeNothingToReview = "nothing_to_review" )
Rollup outcome values.
Variables ¶
This section is empty.
Functions ¶
func RenderAction ¶
func RenderAction(marker ActionMarker) (string, error)
RenderAction returns the canonical marker for a body-bearing action.
func RenderSkip ¶
func RenderSkip() string
RenderSkip returns the canonical marker that disables codereview for a PR.
func RenderThreadSummary ¶
func RenderThreadSummary(marker ThreadSummaryMarker) (string, error)
RenderThreadSummary returns the canonical marker for a thread summary.
func SanitizeModelContent ¶
SanitizeModelContent escapes codereview marker openings in model-authored text. It leaves unrelated HTML comment syntax to the caller's output-context escaping.
Types ¶
type ActionMarker ¶
type ActionMarker struct {
RunID string
ActionID string
Kind string
SHA string
BaseSHA string
Outcome string
}
ActionMarker identifies a body-bearing action emitted by a codereview run.
func FindActions ¶
func FindActions(body string) []ActionMarker
FindActions returns all valid canonical action markers in body order.
func ParseAction ¶
func ParseAction(text string) (ActionMarker, error)
ParseAction parses one canonical body-bearing action marker.
type ThreadSummaryMarker ¶
ThreadSummaryMarker identifies a codereview-authored thread summary.
func FindThreadSummaries ¶
func FindThreadSummaries(body string) []ThreadSummaryMarker
FindThreadSummaries returns all valid canonical thread-summary markers in body order.
func ParseThreadSummary ¶
func ParseThreadSummary(text string) (ThreadSummaryMarker, error)
ParseThreadSummary parses one canonical thread-summary marker.