Documentation
¶
Overview ¶
Package selectors holds the TargetSelector kinds a tool run picks its targets with: files, go_modules, python_projects, ts_workspace and staged_files.
Index ¶
Constants ¶
View Source
const ( // KindFiles selects the codebase files matching TargetSpec.Glob (every file when // empty), optionally dropping Dockerfiles that use a heredoc. KindFiles = "files" // KindFileDirs selects the distinct directories of the files KindFiles would select: // one target per directory, however many of its files match (a chart's tests dir). KindFileDirs = "file_dirs" // KindGoModules selects the Go module directories (go.work `use` entries, else every // go.mod's directory), optionally only those owning a Go file. KindGoModules = "go_modules" // KindPythonProjects selects every directory holding a pyproject.toml. KindPythonProjects = "python_projects" // KindTSWorkspace selects the pnpm workspace package directories named by // pnpm-workspace.yaml. KindTSWorkspace = "ts_workspace" // KindStagedFiles selects the files staged in git, filtered by TargetSpec.Glob. KindStagedFiles = "staged_files" )
Variables ¶
This section is empty.
Functions ¶
func NewFromConfig ¶
func NewFromConfig(kind string, deps Deps) (interfaces.TargetSelector, error)
NewFromConfig returns the selector kind names, narrowed by the spec's Roots and Exclude. An unknown kind, or KindStagedFiles without Deps.Git, is CodeInvalidInput.
Types ¶
type Deps ¶
type Deps struct {
// Git lists staged files for KindStagedFiles.
Git interfaces.GitOps
// Root is the working-tree root KindStagedFiles asks git about.
Root string
}
Deps carries what the git-backed kinds need.
Click to show internal directories.
Click to hide internal directories.