Documentation
¶
Index ¶
- Constants
- func AnnotateImports(imports resolver.ImportMap, comments *build.Comments, prefix string)
- func DirectiveNames() []string
- type Config
- func Get(config *config.Config) *Config
- func GetOrCreate(universe resolver.Universe, config *config.Config, rel string) *Config
- func New(universe resolver.Universe, config *config.Config, rel string) *Config
- func NewTestScalaConfig(t *testing.T, universe resolver.Universe, rel string, dd ...rule.Directive) (*Config, error)
- func (c *Config) Comment() build.Comment
- func (c *Config) Config() *config.Config
- func (c *Config) ConfiguredRules() []*scalarule.Config
- func (c *Config) Exports(exports resolver.ImportMap, r *rule.Rule, attrName string, from label.Label)
- func (c *Config) GetImplicitImports(lang, imp string) (deps []string)
- func (c *Config) GetKnownRule(from label.Label) (*rule.Rule, bool)
- func (c *Config) Imports(imports resolver.ImportMap, r *rule.Rule, attrName string, from label.Label)
- func (c *Config) MaybeRewrite(kind string, from label.Label) label.Label
- func (c *Config) ParseDirectives(directives []rule.Directive) (err error)
- func (c *Config) Rel() string
- func (c *Config) ResolveConflict(r *rule.Rule, imports resolver.ImportMap, imp *resolver.Import, ...) (*resolver.Symbol, bool)
- func (c *Config) ShouldAnnotateImports() bool
- func (c *Config) ShouldAnnotateRule() bool
- func (c *Config) ShouldFixWildcardImport(filename, wimp string) bool
- func (c *Config) ShouldResolveFileSymbolName(filename, name string) bool
- func (c *Config) String() string
Constants ¶
const ( DebugUnknown debugAnnotation = 0 DebugImports debugAnnotation = 1 DebugExports debugAnnotation = 2 DebugDeps debugAnnotation = 3 DebugRule debugAnnotation = 4 )
Variables ¶
This section is empty.
Functions ¶
func AnnotateImports ¶
func DirectiveNames ¶
func DirectiveNames() []string
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents the config extension for the a scala package.
func GetOrCreate ¶
getOrCreateScalaConfig either inserts a new config into the map under the language name or replaces it with a clone.
func NewTestScalaConfig ¶
func (*Config) ConfiguredRules ¶
ConfiguredRules returns an ordered list of configured rules
func (*Config) GetImplicitImports ¶
func (*Config) GetKnownRule ¶
GetKnownRule translates relative labels into their absolute form.
func (*Config) MaybeRewrite ¶
MaybeRewrite takes a rule kind and a from label and possibly transforms the label name based on the configuration of label name rewrites. For example, consider a rule macro `my_scala_app` having a label name ':app', and a file Helper.scala, and the definition of the macro passes `srcs` to an an internal scala_library named ':lib' (that includes Helper.scala). For other scala rules that import 'Helper', we want to depend on `//somepkg:lib` rather than `somepkg:app`.
func (*Config) ParseDirectives ¶
parseDirectives is called in each directory visited by gazelle. The relative directory name is given by 'rel' and the list of directives in the BUILD file are specified by 'directives'.
func (*Config) ResolveConflict ¶
func (*Config) ShouldAnnotateImports ¶
func (*Config) ShouldAnnotateRule ¶
func (*Config) ShouldFixWildcardImport ¶
ShouldFixWildcardImport tests whether the given symbol name pattern should be resolved within the scope of the given filename pattern. resolveFileSymbolNameSpecs represent a whitelist; if no patterns match, false is returned.
func (*Config) ShouldResolveFileSymbolName ¶
ShouldResolveFileSymbolName tests whether the given symbol name pattern should be resolved within the scope of the given filename pattern. resolveFileSymbolNameSpecs represent a whitelist; if no patterns match, false is returned.