config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 6 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 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