Documentation
¶
Overview ¶
Package polyglot detects multi-language repository structures by scanning manifest files (go.mod, package.json, Cargo.toml, etc.) and grouping source files into language-specific layers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifyLayerRole ¶
ClassifyLayerRole is the public entry point for role classification. It takes source code snippets from a single layer and returns one of: "server", "client", "worker", or "library".
Types ¶
type CargoInfo ¶
type CargoInfo struct {
Name string
Version string
Edition string
Dependencies []string
DevDependencies []string
WorkspaceMembers []string
}
CargoInfo contains metadata extracted from a Cargo.toml file.
func ParseCargoToml ¶
ParseCargoToml extracts dependency and metadata from Cargo.toml content. Uses simple line-based parsing to avoid adding a TOML dependency.
type Layer ¶
Layer represents a distinct language area within the repository, typically rooted at a manifest file (go.mod, package.json, etc.).
type RepoStructure ¶
RepoStructure describes the detected language layout of a repository.
func DetectStructure ¶
func DetectStructure(files []*ingest.File) *RepoStructure
DetectStructure scans a list of ingested files for manifest files, groups files by the nearest manifest root, and builds layers.
func (*RepoStructure) IsPolyglot ¶
func (rs *RepoStructure) IsPolyglot() bool
IsPolyglot reports whether the repository contains 2 or more languages each with at least polyglotThreshold source files.