configfile

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const FileName = ".cfv.toml"

Variables

This section is empty.

Functions

func Discover

func Discover(startDir string) string

Discover walks up from startDir looking for a .cfv.toml file. Returns the path if found, or empty string if not found.

Types

type CSVOptions

type CSVOptions struct {
	Delimiter  *string `toml:"delimiter"`
	Comment    *string `toml:"comment"`
	LazyQuotes *bool   `toml:"lazy-quotes"`
}

CSVOptions configures the CSV validator.

type Config

type Config struct {
	ExcludeDirs      []string          `toml:"exclude-dirs"`
	ExcludeFileTypes []string          `toml:"exclude-file-types"`
	FileTypes        []string          `toml:"file-types"`
	Depth            *int              `toml:"depth"`
	Reporter         []string          `toml:"reporter"`
	GroupBy          []string          `toml:"groupby"`
	Quiet            *bool             `toml:"quiet"`
	RequireSchema    *bool             `toml:"require-schema"`
	NoSchema         *bool             `toml:"no-schema"`
	SchemaStore      *bool             `toml:"schemastore"`
	SchemaStorePath  *string           `toml:"schemastore-path"`
	Globbing         *bool             `toml:"globbing"`
	Gitignore        *bool             `toml:"gitignore"`
	SchemaMap        map[string]string `toml:"schema-map"`
	TypeMap          map[string]string `toml:"type-map"`
	Validators       ValidatorOptions  `toml:"validators"`
}

Config represents the parsed .cfv.toml configuration file.

func Load

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

Load reads and validates a .cfv.toml file at the given path. It validates TOML syntax first, then validates against the embedded schema.

type INIOptions

type INIOptions struct {
	ForbidDuplicateKeys *bool `toml:"forbid-duplicate-keys"`
}

INIOptions configures the INI validator.

type JSONOptions

type JSONOptions struct {
	ForbidDuplicateKeys *bool `toml:"forbid-duplicate-keys"`
}

JSONOptions configures the JSON validator.

type ValidatorOptions

type ValidatorOptions struct {
	CSV  *CSVOptions  `toml:"csv"`
	JSON *JSONOptions `toml:"json"`
	INI  *INIOptions  `toml:"ini"`
}

ValidatorOptions holds per-validator configuration.

Jump to

Keyboard shortcuts

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