Documentation
¶
Overview ¶
Package render formats gitscan command results for output. It is not part of the gogit library's public API — cmd/*.go calls into it so the formatting logic can be unit tested without invoking Cobra or capturing os.Stdout.
Index ¶
- Variables
- func ApplyTimezone(commits []gogit.Commit, tz string) ([]gogit.Commit, error)
- func Dep(w io.Writer, results []scanner.RepoResult, opts DepOptions)
- func Order(w io.Writer, sorted []scanner.RepoResult, allResults []scanner.RepoResult)
- func Pending(w io.Writer, format string, report PendingReport) error
- func Scan(w io.Writer, results []scanner.RepoResult, opts ScanOptions) error
- func Since(w io.Writer, results []scanner.RepoResult, opts SinceOptions)
- type DepOptions
- type PendingReport
- type ScanOptions
- type SinceOptions
Constants ¶
This section is empty.
Variables ¶
var PendingFormats = []string{"table", "markdown", "json"}
PendingFormats lists the format values Pending accepts.
var PendingTimezones = []string{"original", "local", "utc"}
PendingTimezones lists the --tz values ApplyTimezone accepts.
var ScanFormats = []string{"list", "table"}
ScanFormats lists the format values Scan accepts.
Functions ¶
func ApplyTimezone ¶
ApplyTimezone returns a copy of commits with each CommitDate converted per tz: "original" (or "") leaves each commit's own recorded offset untouched, "local" converts to the calling machine's local timezone, and "utc" converts to UTC.
func Dep ¶
func Dep(w io.Writer, results []scanner.RepoResult, opts DepOptions)
Dep renders gitscan dep's report to w: results sorted by name, filtered to those matching opts.ModulePath (per RepoResult.MatchesDependency), followed by a summary.
func Order ¶
func Order(w io.Writer, sorted []scanner.RepoResult, allResults []scanner.RepoResult)
Order renders gitscan order's topological update-order report to w. sorted is the (already topologically-sorted and filtered) list to display; allResults is the full result set used to look up internal dependency names for each row.
func Pending ¶
func Pending(w io.Writer, format string, report PendingReport) error
Pending renders a PendingReport to w in the given format: "table" (aligned columns via text/tabwriter, for direct terminal reading), "markdown" (copy-pasteable GitHub-flavored table), or "json" (structured envelope, for agents).
func Scan ¶
func Scan(w io.Writer, results []scanner.RepoResult, opts ScanOptions) error
Scan renders gitscan's root issue-scan report to w: results sorted by name, one row per repo that has an issue (or every repo, if opts.ShowClean), followed by an optional summary.
func Since ¶
func Since(w io.Writer, results []scanner.RepoResult, opts SinceOptions)
Since renders gitscan since's report to w: results sorted by name, filtered to those modified within opts.Duration (further AND-filtered by opts.DepFilter/opts.UnpushedOnly when set), followed by a summary.
Types ¶
type DepOptions ¶
type DepOptions struct {
ModulePath string
DirectOnly bool
Prefix bool
Recurse bool // include the nested-go.mod-count annotation
}
DepOptions configures Dep's filtering and output.
type PendingReport ¶
type PendingReport struct {
Repo string
Mode string // "unpushed" or "since-commit"
Ref string // "@{upstream}" or an explicit commit hash
Commits []gogit.Commit
}
PendingReport describes a set of commits pending push, for rendering.
type ScanOptions ¶
type ScanOptions struct {
Format string // "list" (default) or "table"
ShowClean bool // also print repos with no issues
ShowSummary bool // print the summary block at the end
CheckWorkflows bool // include workflow compliance columns/summary
}
ScanOptions configures Scan's output.
type SinceOptions ¶
type SinceOptions struct {
Duration time.Duration
DurationLabel string // the original duration string, for the summary line
DepFilter string // AND-combined with the modification-time filter
UnpushedOnly bool // AND-combined with the modification-time filter
}
SinceOptions configures Since's filtering and output.