config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 4 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 user configuration files for Diffmantic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CandidateConfigFilePaths

func CandidateConfigFilePaths() ([]string, error)

CandidateConfigFilePaths returns config file paths to try in order of preference.

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the path to the diffmantic config directory, respecting $XDG_CONFIG_HOME or falling back to ~/.config/diffmantic.

Types

type Config

type Config struct {
	Format          string `yaml:"format"`
	TabWidth        int    `yaml:"tab_width"`
	IgnoreComments  bool   `yaml:"ignore_comments"`
	ParseErrorLimit int    `yaml:"parse_error_limit"`
	SizeLimit       *int   `yaml:"size_limit,omitempty"`
	LineLimit       *int   `yaml:"line_limit,omitempty"`
}

Config holds all user configuration settings for diffmantic.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the baseline configuration when no config file is found.

func Load

func Load() (*Config, error)

Load reads configuration from ~/.config/diffmantic/config.yml (or config.yaml). If no config file exists, it returns DefaultConfig.

func (*Config) UnmarshalYAML added in v0.8.0

func (c *Config) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML supports both modern config fields and legacy tui.tab_width.

Jump to

Keyboard shortcuts

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