Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDependencyUsagePlugin ¶
func NewDependencyUsagePlugin(usageCallback DependencyUsageCallback) *dependencyUsagePlugin
depsusage plugin collects the usage evidence for the imported dependencies. It uses tree-sitter to parse the imported dependency-identifier relations in the source code and verify the usage of dependencies based on identifier usage.
Types ¶
type DependencyUsageCallback ¶
type DependencyUsageCallback core.PluginCallback[*UsageEvidence]
type UsageEvidence ¶
type UsageEvidence struct {
PackageHint string // PackageHint: A hint of what could be the package containing this module
// ModuleName: The module name taken directly from the ImportNode
ModuleName string
// The imported item name taken directly from the ImportNode
ModuleItem string
// The import alias name taken directly from the ImportNode
ModuleAlias string
// Whether the usage is a wildcard usage
IsWildCardUsage bool
// The identifier which led to this usage evidence
Identifier string
// File path where the usage was found
FilePath string
// Line number where the usage was found
Line uint
}
UsageEvidence represents the evidence of usage of a module item in a file
func (*UsageEvidence) String ¶
func (e *UsageEvidence) String() string
Click to show internal directories.
Click to hide internal directories.