package kustomize import ( "fmt" "github.com/bazelbuild/bazel-gazelle/rule" ) const ( srcsAttr = "srcs" depsAttr = "deps" imgsAttr = "images" rulesPackage = "hack/build/rules/kustomize" ) var gazellePath = fmt.Sprintf("//%s/gazelle:gazelle_kustomize", rulesPackage) var kinds = map[string]rule.KindInfo{ "kustomization": { MatchAny: true, // Only one kustomization rule per package MergeableAttrs: map[string]bool{ "srcs": true, "kustomization_yaml": true, "visibility": true, "images": true, }, ResolveAttrs: map[string]bool{ "deps": true, }, }, } func (k *Kustomize) Kinds() map[string]rule.KindInfo { return kinds } // ApparentLoads maps module loads to import paths. Because this ruleset is // checked in, we always return the constant path to the package. func (k *Kustomize) ApparentLoads(_ func(string) string) []rule.LoadInfo { return []rule.LoadInfo{ { Name: fmt.Sprintf("//%s:kustomization.bzl", rulesPackage), Symbols: []string{ "kustomization", }, }, } }