Documentation
¶
Overview ¶
Package brief detects a software project's toolchain, configuration, and conventions, then outputs a structured report.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KnowledgeFS embed.FS
var Version = "dev"
Version is set at build time via ldflags.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
Run string `json:"run"`
Alternatives []string `json:"alternatives,omitempty"`
Source Source `json:"source"`
InferredTool string `json:"inferred_tool,omitempty"`
}
Command is a runnable command with provenance.
type Confidence ¶
type Confidence string
Confidence indicates how reliable a detection signal is.
const ( ConfidenceHigh Confidence = "high" ConfidenceMedium Confidence = "medium" ConfidenceLow Confidence = "low" )
type DepInfo ¶ added in v0.2.0
type DepInfo struct {
Name string `json:"name"`
Version string `json:"version,omitempty"`
PURL string `json:"purl"`
Scope string `json:"scope,omitempty"` // "runtime", "development", "test", "build"
Direct bool `json:"direct"`
}
DepInfo is a parsed dependency from a manifest file.
type Detection ¶
type Detection struct {
Name string `json:"name"`
Category string `json:"category"`
Confidence Confidence `json:"confidence"`
Command *Command `json:"command,omitempty"`
ConfigFiles []string `json:"config_files,omitempty"`
Lockfile string `json:"lockfile,omitempty"`
Homepage string `json:"homepage,omitempty"`
Docs string `json:"docs,omitempty"`
Repo string `json:"repo,omitempty"`
Description string `json:"description,omitempty"`
}
Detection is a single detected tool or feature.
type EnrichmentInfo ¶ added in v0.2.0
type EnrichmentInfo struct {
Repo *RepoEnrichment `json:"repo,omitempty"`
Packages []PublishedPackage `json:"packages,omitempty"`
RuntimeEOL map[string]*RuntimeEOL `json:"runtime_eol,omitempty"`
}
EnrichmentInfo holds metadata fetched from external sources about the project itself.
type GitInfo ¶
type GitInfo struct {
Branch string `json:"branch,omitempty"`
DefaultBranch string `json:"default_branch,omitempty"`
Remotes map[string]string `json:"remotes,omitempty"` // name -> URL
CommitCount int `json:"commit_count,omitempty"`
}
GitInfo describes the git repository state.
type LayoutInfo ¶
type LayoutInfo struct {
SourceDirs []string `json:"source_dirs,omitempty"` // e.g. ["src/", "lib/", "app/"]
TestDirs []string `json:"test_dirs,omitempty"` // e.g. ["spec/", "test/"]
MirrorsSource bool `json:"mirrors_source,omitempty"`
}
LayoutInfo describes the project's file layout conventions.
type LineCount ¶
type LineCount struct {
TotalFiles int `json:"total_files"`
TotalLines int `json:"total_lines"`
ByLanguage map[string]int `json:"by_language,omitempty"`
Source string `json:"source"` // "scc", "tokei", or "fallback"
}
LineCount holds line count information.
type PlatformInfo ¶
type PlatformInfo struct {
RuntimeVersionFiles map[string]string `json:"runtime_version_files,omitempty"`
CIMatrixVersions map[string][]string `json:"ci_matrix_versions,omitempty"`
CIMatrixOS []string `json:"ci_matrix_os,omitempty"`
}
PlatformInfo describes detected platforms and runtime versions.
type PublishedPackage ¶ added in v0.2.0
type PublishedPackage struct {
Name string `json:"name"`
Ecosystem string `json:"ecosystem"`
PURL string `json:"purl"`
LatestVersion string `json:"latest_version,omitempty"`
License string `json:"license,omitempty"`
Description string `json:"description,omitempty"`
Downloads int `json:"downloads,omitempty"`
DownloadsPeriod string `json:"downloads_period,omitempty"`
DependentPackagesCount int `json:"dependent_packages_count,omitempty"`
DependentReposCount int `json:"dependent_repos_count,omitempty"`
RegistryURL string `json:"registry_url,omitempty"`
}
PublishedPackage describes a package this repo publishes to a registry.
type RepoEnrichment ¶ added in v0.2.0
type RepoEnrichment struct {
Scorecard float64 `json:"scorecard,omitempty"`
ScorecardDate string `json:"scorecard_date,omitempty"`
}
RepoEnrichment holds metadata about the project's own repository.
type Report ¶
type Report struct {
Version string `json:"version"`
Path string `json:"path"`
DiffRef string `json:"diff_ref,omitempty"`
ChangedFiles []string `json:"changed_files,omitempty"`
Languages []Detection `json:"languages"`
PackageManagers []Detection `json:"package_managers"`
Scripts []Script `json:"scripts,omitempty"`
Tools map[string][]Detection `json:"tools"`
Style *StyleInfo `json:"style,omitempty"`
Layout *LayoutInfo `json:"layout,omitempty"`
Platforms *PlatformInfo `json:"platforms,omitempty"`
Resources *ResourceInfo `json:"resources,omitempty"`
Git *GitInfo `json:"git,omitempty"`
Lines *LineCount `json:"lines,omitempty"`
Dependencies []DepInfo `json:"dependencies,omitempty"`
Enrichment *EnrichmentInfo `json:"enrichment,omitempty"`
Stats Stats `json:"stats"`
}
Report is the complete output of a brief analysis.
type ResourceInfo ¶
type ResourceInfo struct {
Readme string `json:"readme,omitempty"`
Contributing string `json:"contributing,omitempty"`
Changelog string `json:"changelog,omitempty"`
License string `json:"license,omitempty"`
LicenseType string `json:"license_type,omitempty"`
Security string `json:"security,omitempty"`
}
ResourceInfo describes project resource files.
type RuntimeEOL ¶ added in v0.2.0
type RuntimeEOL struct {
EOL string `json:"eol,omitempty"` // date string or "true"/"false"
Supported bool `json:"supported"`
LTS bool `json:"lts,omitempty"`
Latest string `json:"latest,omitempty"` // latest patch version
}
RuntimeEOL holds end-of-life status for a runtime version.
type Script ¶
type Script struct {
Name string `json:"name"`
Run string `json:"run"`
Source string `json:"source"` // e.g. "Makefile", "package.json"
}
Script is a project-defined task (Makefile target, package.json script, etc.).
type Stats ¶
type Stats struct {
Duration time.Duration `json:"-"`
DurationMS float64 `json:"duration_ms"`
FilesChecked int `json:"files_checked"`
ToolsMatched int `json:"tools_matched"`
ToolsChecked int `json:"tools_checked"`
}
Stats holds performance and coverage metrics from the detection run.
type StyleInfo ¶
type StyleInfo struct {
Indentation string `json:"indentation,omitempty"` // e.g. "2-space", "4-space", "tabs"
IndentSource string `json:"indent_source,omitempty"` // e.g. "editorconfig", "inferred"
LineEnding string `json:"line_ending,omitempty"` // "LF" or "CRLF"
TrailingNewline *bool `json:"trailing_newline,omitempty"`
}
StyleInfo describes detected coding style conventions.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
brief
command
|
|
|
Package detect implements the project detection engine.
|
Package detect implements the project detection engine. |
|
Package kb loads and queries the embedded TOML knowledge base.
|
Package kb loads and queries the embedded TOML knowledge base. |
|
Package remote resolves remote sources (git URLs, registry packages) to local directories for scanning.
|
Package remote resolves remote sources (git URLs, registry packages) to local directories for scanning. |
|
Package report formats brief detection results for output.
|
Package report formats brief detection results for output. |