gazelle

package
v1.509.19 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCollisionErrors added in v1.508.19

func CheckCollisionErrors(targetName, expectedKind string, generatedKinds *treeset.Set, args language.GenerateArgs) error

Check if a target with the same name we are generating already exists, and that rule type is unknown or can not be adapted to the new rule kind. If an existing rule can not be adapted (maybe due to Gazelle bugs/limitations) an error explaining the case is returned.

func GazelleWalkDir

func GazelleWalkDir(args language.GenerateArgs, ignore *git.GitIgnore, excludes []string, recurse bool, walkFunc GazelleWalkFunc) error

Walk the directory of the language.GenerateArgs, optionally recursing into subdirectories unlike the files provided in GenerateArgs.RegularFiles.

func GetFileRuleByName added in v1.508.19

func GetFileRuleByName(args language.GenerateArgs, ruleName string) *rule.Rule

func IsBazelPackage

func IsBazelPackage(dir string) bool

IsBazelPackage determines if the directory is a Bazel package by probing for the existence of a known BUILD file name.

func IsFileExcluded

func IsFileExcluded(rel, fileRelPath string, excludes []string) bool

func MapKind added in v1.508.19

func MapKind(args language.GenerateArgs, kind string) string

func RemoveRule added in v1.508.19

func RemoveRule(args language.GenerateArgs, ruleName string, generatedKinds *treeset.Set, result *language.GenerateResult)

func ToDefaultTargetName

func ToDefaultTargetName(args language.GenerateArgs, defaultRootName string) string

Return the default target name for the given language.GenerateArgs. The default target name of a BUILD is the directory name. WHen within the repository root which may be outside of version control the default target name is the repository name.

Types

type GazelleWalkFunc

type GazelleWalkFunc func(path string) error

type LabelSet

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

A basic set of label.Labels with logging of set modifications.

func NewLabelSet

func NewLabelSet(from label.Label) *LabelSet

func (*LabelSet) Add

func (s *LabelSet) Add(l *label.Label)

func (*LabelSet) Empty

func (s *LabelSet) Empty() bool

func (*LabelSet) Labels

func (s *LabelSet) Labels() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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