marker

package
v0.10.257 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package marker renders and parses codereview PR comment markers.

Index

Constants

View Source
const (
	ActionKindInlineComment = "inline_comment"
	ActionKindThreadReply   = "thread_reply"
	ActionKindRollupComment = "rollup_comment"
	ActionKindSubmitReview  = "submit_review"
)

Action marker kind values.

View Source
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

func SanitizeModelContent(text string) string

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

type ThreadSummaryMarker struct {
	RunID    string
	ActionID string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL