Documentation
¶
Overview ¶
Package config loads per-project kartograf configuration from .kartograf.yml at the project root. The config file is the only piece of kartograf state meant to be committed to the project repo; the index database itself is a derived artifact and lives in the user cache directory.
Index ¶
Constants ¶
const FileName = ".kartograf.yml"
FileName is the config file looked up at the project root.
Variables ¶
var VendorDirNames = map[string]bool{ "vendor": true, "node_modules": true, }
VendorDirNames are directory basenames treated as dependency roots.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Include lists root-relative directories to index.
// Empty means the whole project root.
Include []string `yaml:"include"`
// Exclude lists extra gitignore-style patterns applied on top of
// the project's .gitignore files.
Exclude []string `yaml:"exclude"`
// Vendor controls dependency directories (vendor/, node_modules/):
// "index" (default) indexes them flagged as vendor code,
// "skip" leaves them out entirely.
Vendor string `yaml:"vendor"`
// Task describes how a task id shows up in git branch names.
// Used by find_task. An empty Branch matches any branch whose
// name contains the id.
Task Task `yaml:"task"`
// Enrich tells kartograf where to obtain a graph that was built
// on a machine that has PHP or Go.
Enrich Enrich `yaml:"enrich"`
// Stats is the optional price used to turn token estimates into money.
Stats Stats `yaml:"stats"`
}
type Enrich ¶ added in v0.1.16
type Enrich struct {
// URL is an https template containing "{commit}". When the local
// PHPStan exchange file is missing or was built at another commit,
// serve/index downloads it. Example:
// https://example.com/kartograf/{commit}/enrich.phpstan.jsonl
URL string `yaml:"url"`
}
Enrich is the optional download of a prebuilt exchange file.
type Stats ¶ added in v0.1.16
type Stats struct {
// DollarsPerMillion is the price of one million tokens the agent
// spends reading source. Zero leaves the report in tokens only.
DollarsPerMillion float64 `yaml:"dollars_per_million"`
}
Stats configures the local usage report. Nothing is uploaded.
type Task ¶ added in v0.1.15
type Task struct {
// Branch is a template containing "{id}", for example
// "feature/{id}-". The id the user named replaces "{id}", and a
// branch matches when its name contains the result.
Branch string `yaml:"branch"`
}
Task is the optional branch-name rule for one repository.