config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config handles loading and validating .contextception/config.yaml.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version     int      `yaml:"version"`
	Entrypoints []string `yaml:"entrypoints,omitempty"`
	Ignore      []string `yaml:"ignore,omitempty"`
	Generated   []string `yaml:"generated,omitempty"`
}

Config represents the user's repository configuration.

func Empty

func Empty() *Config

Empty returns a zero-value config where all predicates return false.

func Load

func Load(repoRoot string) (*Config, error)

Load reads .contextception/config.yaml from repoRoot. Returns Empty() if the file does not exist. Returns an error if the file exists but is malformed or contains unknown keys.

func (*Config) IsConfigEntrypoint

func (c *Config) IsConfigEntrypoint(path string) bool

IsConfigEntrypoint returns true if path exactly matches a config entrypoint.

func (*Config) IsGenerated

func (c *Config) IsGenerated(path string) bool

IsGenerated returns true if path matches any config generated prefix.

func (*Config) IsIgnored

func (c *Config) IsIgnored(path string) bool

IsIgnored returns true if path matches any config ignore prefix.

func (*Config) Validate

func (c *Config) Validate(repoRoot string) (warnings []string, err error)

Validate checks config for correctness. Returns warnings for non-fatal issues (e.g. non-existent paths) and an error for fatal issues (e.g. wrong version, absolute paths).

type RepoProfile

type RepoProfile struct {
	Type        string   // monorepo, python-package, go-module, ts-project, mixed, unknown
	Signals     []string // detection signals found
	Entrypoints []string // auto-detected entrypoints
}

RepoProfile represents an auto-detected repository type.

func DetectRepoProfile

func DetectRepoProfile(repoRoot string) RepoProfile

DetectRepoProfile detects the repository type from file structure. Returns a profile with type and suggested entrypoints.

Jump to

Keyboard shortcuts

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