starlark

package
v1.509.25 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandSrcs

func ExpandSrcs(repoRoot, pkg string, expr bzl.Expr) ([]string, error)

func IsCustomSrcs

func IsCustomSrcs(srcs bzl.Expr) bool

Types

type BazelPackageTree

type BazelPackageTree struct {
	// contains filtered or unexported fields
}

BazelPackageTree is a representation of a filesystem tree specialized for filtering paths that are under a Bazel sub-package. It understands the file-based boundaries that represent a sub-package (a nested BUILD file). The nature of this data structure also enables us to remove duplicated paths.

func NewBazelPackageTree

func NewBazelPackageTree(pkg string) *BazelPackageTree

NewBazelPackageTree constructs a new BazelPackageTree.

func (*BazelPackageTree) AddPath

func (pt *BazelPackageTree) AddPath(parts []string)

AddPath adds a path to the package tree.

func (*BazelPackageTree) Paths

func (pt *BazelPackageTree) Paths() []starlark.Value

Paths returns the list of paths in the tree, filtering Bazel sub-packages.

type Globber

type Globber struct {
	// contains filtered or unexported fields
}

Globber implements the glob built-in to evaluate the srcs attribute containing glob patterns.

func (*Globber) Glob

func (g *Globber) Glob(
	_ *starlark.Thread,
	_ *starlark.Builtin,
	args starlark.Tuple,
	kwargs []starlark.Tuple,
) (starlark.Value, error)

Glob expands the glob patterns and filters Bazel sub-packages from the tree. This is used to index manually created targets that contain globs so the resolution phase depends less on `gazelle:resolve` directives set by the user.

Jump to

Keyboard shortcuts

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