config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 12 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 .stringer.yaml configuration files.

Index

Constants

View Source
const FileName = ".stringer.yaml"

FileName is the expected config file name in a repository root.

Variables

This section is empty.

Functions

func Merge

func Merge(fileCfg *Config, cliCfg signal.ScanConfig) signal.ScanConfig

Merge combines file-based config with CLI-provided ScanConfig. CLI values take precedence; zero-value CLI fields fall through to file config.

func Validate

func Validate(cfg *Config) error

Validate checks all fields in the config and returns all errors at once.

func Write

func Write(w io.Writer, cfg *Config) error

Write marshals the config to YAML and writes it to w.

Types

type CollectorConfig

type CollectorConfig struct {
	Enabled         *bool    `yaml:"enabled,omitempty"`
	ErrorMode       string   `yaml:"error_mode,omitempty"`
	MinConfidence   float64  `yaml:"min_confidence,omitempty"`
	IncludePatterns []string `yaml:"include_patterns,omitempty"`
	ExcludePatterns []string `yaml:"exclude_patterns,omitempty"`

	// Lottery risk collector settings.
	LotteryRiskThreshold int `yaml:"lottery_risk_threshold,omitempty"`
	DirectoryDepth       int `yaml:"directory_depth,omitempty"`
	MaxBlameFiles        int `yaml:"max_blame_files,omitempty"`

	// Patterns collector settings.
	LargeFileThreshold int `yaml:"large_file_threshold,omitempty"`

	// Git collector settings.
	GitDepth int    `yaml:"git_depth,omitempty"`
	GitSince string `yaml:"git_since,omitempty"`

	// GitHub collector settings.
	IncludePRs            *bool  `yaml:"include_prs,omitempty"`
	CommentDepth          int    `yaml:"comment_depth,omitempty"`
	MaxIssuesPerCollector int    `yaml:"max_issues_per_collector,omitempty"`
	IncludeClosed         *bool  `yaml:"include_closed,omitempty"`
	HistoryDepth          string `yaml:"history_depth,omitempty"`

	// Anonymization settings.
	Anonymize string `yaml:"anonymize,omitempty"`

	// IncludeDemoPaths disables demo-path filtering for noise-prone signals.
	IncludeDemoPaths *bool `yaml:"include_demo_paths,omitempty"`

	// Timeout is the per-collector timeout (e.g. "60s", "2m").
	Timeout string `yaml:"timeout,omitempty"`
}

CollectorConfig holds per-collector settings in the config file.

type Config

type Config struct {
	OutputFormat string                     `yaml:"output_format,omitempty"`
	MaxIssues    int                        `yaml:"max_issues,omitempty"`
	NoLLM        bool                       `yaml:"no_llm,omitempty"`
	BeadsAware   *bool                      `yaml:"beads_aware,omitempty"`
	Collectors   map[string]CollectorConfig `yaml:"collectors,omitempty"`
}

Config represents the contents of a .stringer.yaml file.

func Load

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

Load reads the .stringer.yaml file from the given repository root. If the file does not exist, it returns a zero-value Config and nil error.

Jump to

Keyboard shortcuts

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