Documentation
¶
Overview ¶
Package scope is which checkouts a command answers for: -C and the user's groups, repos and people, read from the user config files.
Index ¶
- Constants
- func HeaderRow(w io.Writer, label, value string, limit int, style lipgloss.Style)
- func LinkedHeaderRow(w io.Writer, label, value, target string, limit int, style lipgloss.Style)
- func ReadBoardConfig() (boardConfig, string, error)
- func ReadGroups(file string, names []string) ([]scopeItem, error)
- func ReadLastStandup() (*standup.Last, error)
- func ReadUserConfig(file string, cfg any) (string, error)
- func ReadWorkdays() (calendar.Workdays, error)
- func ScopeItems(cmd *cli.Command, groupsFile string, repos []repoEntry, reposPath string) ([]scopeItem, error)
- func Scoped(cmd *cli.Command) bool
- func StandupTargets(ctx context.Context, cmd *cli.Command) ([]*target.Target, error)
- func WriteLastStandup(last standup.Last) error
- type Person
- type RepoRef
- type ScopeEntry
Constants ¶
const ( StandupStateFile = "standup.json" // the last reported standup; f10 writes it StandupConfigFile = "standup.md" // the user's standup settings; f10 only reads it BoardConfigFile = "board.md" // the user's board settings; f10 only reads it )
A standup's period and a board's scope are the person's, not a checkout's, so these files live in ~/.f10/, with an extension no project directory there carries.
const HeaderIndent = 16
HeaderIndent is the value column of the header block: the widest label, "checkout root", plus the gap.
const ScopeParallel = 4
ScopeParallel: the host CLI's calls are most of a scoped command's time.
Variables ¶
This section is empty.
Functions ¶
func LinkedHeaderRow ¶
LinkedHeaderRow links each wrapped line to target, since wrapping a value that already holds a link's escapes would cut them apart.
func ReadBoardConfig ¶
ReadBoardConfig is ~/.f10/board.md, with the people every run reads checked; a repository entry is read only by the --all run that uses it.
func ReadGroups ¶
ReadGroups: a glob keeps the checkouts it matches and skips the rest; a plain path that is not a checkout is an error, since the user named it. The user declared each entry, so this is not the walk F10_ROOTS fences.
func ReadLastStandup ¶
ReadLastStandup is nil when none was reported; a file that does not read is an error, since dropping it would silently move the period.
func ReadUserConfig ¶
ReadUserConfig leaves cfg as it was for a missing file or one with no frontmatter. Each caller reads only the key it needs, so a broken file fails only a run that uses it.
func ReadWorkdays ¶
ReadWorkdays is Monday to Friday when standup.md is missing or does not say.
func ScopeItems ¶
func ScopeItems(cmd *cli.Command, groupsFile string, repos []repoEntry, reposPath string) ([]scopeItem, error)
ScopeItems is what the flags name, in scope order, before anything is bound.
func StandupTargets ¶
StandupTargets fails on a checkout that fails, named: dropping it would leave its work out of a report meant to be whole.
func WriteLastStandup ¶
WriteLastStandup replaces the stored standup through a rename, so a reader never sees half a file.
Types ¶
type RepoRef ¶
type RepoRef struct {
CLI string // gh or glab
Host string // github.com
Path string // owner/repo, or group/sub/project
Prefix string // the task id prefix its ids are read with
}
A RepoRef is a repository named outright, as `host/owner/repo`.
type ScopeEntry ¶
type ScopeEntry struct {
Dir string
Main string // the main checkout, for a board of a checkout that would not bind
ID string // its project id, the normalised remote
Target *target.Target
Repo *RepoRef
Err error
}
A ScopeEntry is one bound project, or the error binding it, for the command to decide on.
func BindScope ¶
func BindScope(ctx context.Context, items []scopeItem, cmdName string) []ScopeEntry
BindScope reads one repository once across its main checkout and worktrees, and drops a repository named outright that a checkout covers, since the checkout knows more; checkouts bind first so every id is known by then.