config

package
v0.1.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const FileName = ".kartograf.yml"

FileName is the config file looked up at the project root.

Variables

View Source
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"`
}

func Default

func Default() Config

func Load

func Load(root string) (Config, error)

Load reads .kartograf.yml from root if present; a missing file yields the default config.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL