...

Source file src/edge-infra.dev/hack/build/rules/kustomize/gazelle/language/kinds.go

Documentation: edge-infra.dev/hack/build/rules/kustomize/gazelle/language

     1  package kustomize
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/bazelbuild/bazel-gazelle/rule"
     7  )
     8  
     9  const (
    10  	srcsAttr     = "srcs"
    11  	depsAttr     = "deps"
    12  	imgsAttr     = "images"
    13  	rulesPackage = "hack/build/rules/kustomize"
    14  )
    15  
    16  var gazellePath = fmt.Sprintf("//%s/gazelle:gazelle_kustomize", rulesPackage)
    17  
    18  var kinds = map[string]rule.KindInfo{
    19  	"kustomization": {
    20  		MatchAny: true, // Only one kustomization rule per package
    21  		MergeableAttrs: map[string]bool{
    22  			"srcs":               true,
    23  			"kustomization_yaml": true,
    24  			"visibility":         true,
    25  			"images":             true,
    26  		},
    27  		ResolveAttrs: map[string]bool{
    28  			"deps": true,
    29  		},
    30  	},
    31  }
    32  
    33  func (k *Kustomize) Kinds() map[string]rule.KindInfo {
    34  	return kinds
    35  }
    36  
    37  // ApparentLoads maps module loads to import paths. Because this ruleset is
    38  // checked in, we always return the constant path to the package.
    39  func (k *Kustomize) ApparentLoads(_ func(string) string) []rule.LoadInfo {
    40  	return []rule.LoadInfo{
    41  		{
    42  			Name: fmt.Sprintf("//%s:kustomization.bzl", rulesPackage),
    43  			Symbols: []string{
    44  				"kustomization",
    45  			},
    46  		},
    47  	}
    48  }
    49  

View as plain text