scope

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

View Source
const HeaderIndent = 16

HeaderIndent is the value column of the header block: the widest label, "checkout root", plus the gap.

View Source
const ScopeParallel = 4

ScopeParallel: the host CLI's calls are most of a scoped command's time.

Variables

This section is empty.

Functions

func HeaderRow

func HeaderRow(w io.Writer, label, value string, limit int, style lipgloss.Style)

func ItemsOrHere added in v0.59.0

func ItemsOrHere(cmd *cli.Command, groupsFile string) ([]scopeItem, error)

ItemsOrHere is what the flags name, else the checkout -C or the cwd is, for a command that reads checkouts and binds no target.

func LinkedHeaderRow

func LinkedHeaderRow(w io.Writer, label, value, target string, limit int, style lipgloss.Style)

LinkedHeaderRow links each wrapped line to target, since wrapping a value that already holds a link's escapes would cut them apart.

func ReadBoardConfig

func ReadBoardConfig() (boardConfig, string, error)

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

func ReadGroups(file string, names []string) ([]scopeItem, error)

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

func ReadLastStandup() (*standup.Last, error)

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

func ReadUserConfig(file string, cfg any) (string, error)

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

func ReadWorkdays() (calendar.Workdays, error)

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 Scoped

func Scoped(cmd *cli.Command) bool

Scoped reports whether the flags name a scope at all.

func StandupTargets

func StandupTargets(ctx context.Context, cmd *cli.Command) ([]*target.Target, error)

StandupTargets fails on a checkout that fails, named: dropping it would leave its work out of a report meant to be whole.

func WriteLastStandup

func WriteLastStandup(last standup.Last) error

WriteLastStandup replaces the stored standup through a rename, so a reader never sees half a file.

Types

type Person

type Person struct {
	Name    string   `yaml:"name"`
	Tracker string   `yaml:"tracker"`
	Host    string   `yaml:"host"`
	Emails  []string `yaml:"emails"`
}

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`.

func ParseRepo

func ParseRepo(entry, prefix string) (RepoRef, error)

ParseRepo reads `[gh:|glab:]host/owner/repo`; a host other than github.com or gitlab.com must say its CLI with the prefix.

func (RepoRef) ID

func (r RepoRef) ID() string

func (RepoRef) Name

func (r RepoRef) Name() string

func (RepoRef) Repo

func (r RepoRef) Repo() string

Repo is what forge.Host.Repo takes: the host in front only off the CLI's default host.

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; the main checkout's path when Local
	Local  bool   // no remote names the project
	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 is Checkouts with a target bound to each checkout.

func Checkouts added in v0.59.0

func Checkouts(ctx context.Context, items []scopeItem) []ScopeEntry

Checkouts keeps one entry per repository across its main checkout and worktrees, and drops a repository named outright that a checkout covers, since the checkout knows more; checkouts go first so every id is known by then. It binds no target, for a command that reads git alone.

Jump to

Keyboard shortcuts

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