Documentation
¶
Overview ¶
Package list provides functionality for listing and formatting changes and specifications in various output formats.
Package list provides functionality for listing and formatting changes and specifications. This file handles unified formatting for displaying both changes and specs together.
Index ¶
- func FormatAllJSON(items ItemList) (string, error)
- func FormatAllLong(items ItemList) string
- func FormatAllText(items ItemList) string
- func FormatChangesJSON(changes []ChangeInfo) (string, error)
- func FormatChangesLong(changes []ChangeInfo) string
- func FormatChangesText(changes []ChangeInfo) string
- func FormatSpecsJSON(specs []SpecInfo) (string, error)
- func FormatSpecsLong(specs []SpecInfo) string
- func FormatSpecsText(specs []SpecInfo) string
- func RunInteractiveAll(items ItemList, projectPath string) error
- func RunInteractiveArchive(changes []ChangeInfo, projectPath string) (string, error)
- func RunInteractiveChanges(changes []ChangeInfo, projectPath string) (archiveID, prID string, err error)
- func RunInteractiveSpecs(specs []SpecInfo, projectPath string) error
- type ChangeInfo
- type Item
- type ItemList
- type ItemType
- type ListAllOptions
- type Lister
- type SpecInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatAllJSON ¶
FormatAllJSON formats all items as a JSON array. Each item includes its type (change or spec) along with all relevant fields. Items are sorted by ID before serialization. Returns an empty JSON array if no items are provided.
func FormatAllLong ¶
FormatAllLong formats all items with detailed information. Shows ID, type, title, and relevant counts (deltas/tasks for changes, requirements for specs). Items are sorted by ID.
func FormatAllText ¶
FormatAllText formats all items (changes and specs) as text with type indicators. Items are sorted by ID and displayed with their type and relevant details (tasks for changes, requirements for specs).
func FormatChangesJSON ¶
func FormatChangesJSON(changes []ChangeInfo) (string, error)
FormatChangesJSON formats changes as JSON array
func FormatChangesLong ¶
func FormatChangesLong(changes []ChangeInfo) string
FormatChangesLong formats changes with detailed information
func FormatChangesText ¶
func FormatChangesText(changes []ChangeInfo) string
FormatChangesText formats changes as simple text list (IDs only)
func FormatSpecsJSON ¶
FormatSpecsJSON formats specs as JSON array
func FormatSpecsLong ¶
FormatSpecsLong formats specs with detailed information
func FormatSpecsText ¶
FormatSpecsText formats specs as simple text list (IDs only)
func RunInteractiveAll ¶
RunInteractiveAll runs the interactive table for all items (changes and specs)
func RunInteractiveArchive ¶
func RunInteractiveArchive( changes []ChangeInfo, projectPath string, ) (string, error)
RunInteractiveArchive runs the interactive table for archive selection. Returns the selected change ID or empty string if cancelled
func RunInteractiveChanges ¶
func RunInteractiveChanges( changes []ChangeInfo, projectPath string, ) (archiveID, prID string, err error)
RunInteractiveChanges runs the interactive table for changes. Returns (archiveID, prID, error):
- archiveID is set if archive was requested via 'a' key
- prID is set if PR mode was requested via 'P' key
- Both are empty if user quit or cancelled
func RunInteractiveSpecs ¶
RunInteractiveSpecs runs the interactive table for specs
Types ¶
type ChangeInfo ¶
type ChangeInfo struct {
ID string `json:"id"`
Title string `json:"title"`
DeltaCount int `json:"deltaCount"`
TaskStatus parsers.TaskStatus `json:"taskStatus"`
}
ChangeInfo represents information about a change
func FilterChangesNotOnRef ¶
func FilterChangesNotOnRef( changes []ChangeInfo, ref string, ) ([]ChangeInfo, error)
FilterChangesNotOnRef filters the given changes to only include those whose paths do NOT exist on the specified git ref. This is useful for identifying unmerged changes that haven't been merged to the main branch yet. The ref should be a full ref like "origin/main" or "origin/master".
type Item ¶
type Item struct {
// Type indicates whether this item is a change or spec
Type ItemType `json:"type"`
// Change contains the change information if Type == ItemTypeChange
Change *ChangeInfo `json:"change,omitempty"`
// Spec contains the spec information if Type == ItemTypeSpec
Spec *SpecInfo `json:"spec,omitempty"`
}
Item represents a unified wrapper around either a ChangeInfo or SpecInfo. Exactly one of Change or Spec will be non-nil, determined by Type.
func NewChangeItem ¶
func NewChangeItem(change ChangeInfo) Item
NewChangeItem creates a new Item wrapping a ChangeInfo
func NewSpecItem ¶
NewSpecItem creates a new Item wrapping a SpecInfo
type ItemList ¶
type ItemList []Item
ItemList represents a collection of mixed changes and specs
func (ItemList) Changes ¶
func (il ItemList) Changes() []ChangeInfo
Changes returns all ChangeInfo items from the list
func (ItemList) FilterByType ¶
FilterByType returns a new ItemList containing only items of the specified type.
type ListAllOptions ¶
type ListAllOptions struct {
// FilterType specifies which types to include (nil = all types)
FilterType *ItemType
// SortByID sorts items alphabetically by ID (default: true)
SortByID bool
}
ListAllOptions contains optional filtering and sorting parameters for ListAll
type Lister ¶
type Lister struct {
// contains filtered or unexported fields
}
Lister handles listing operations for changes and specs
func (*Lister) ListAll ¶
func (l *Lister) ListAll(opts *ListAllOptions) (ItemList, error)
ListAll retrieves all changes and specs as a unified ItemList
func (*Lister) ListChanges ¶
func (l *Lister) ListChanges() ([]ChangeInfo, error)
ListChanges retrieves information about all active changes