config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConfigFile

func FindConfigFile(startDir string) (string, error)

FindConfigFile searches for a .manque.yml file in the current directory and parent directories

Types

type FileConfig

type FileConfig struct {
	Version int `yaml:"version"`

	Review ReviewConfig `yaml:"review"`
	Ignore []string     `yaml:"ignore"`
	Rules  []PathRule   `yaml:"rules"`
}

FileConfig represents the .manque.yml configuration file

func DefaultConfig

func DefaultConfig() *FileConfig

DefaultConfig returns the default configuration

func LoadFromDirectory

func LoadFromDirectory(dir string) (*FileConfig, error)

LoadFromDirectory finds and loads the config file from a directory

func LoadFromFile

func LoadFromFile(path string) (*FileConfig, error)

LoadFromFile loads configuration from a YAML file

func (*FileConfig) GetRulesForFile

func (c *FileConfig) GetRulesForFile(filename string) string

GetRulesForFile returns the extra rules that apply to a specific file

func (*FileConfig) GetSeverityOverrideForFile

func (c *FileConfig) GetSeverityOverrideForFile(filename string) string

GetSeverityOverrideForFile returns the severity override for a specific file

func (*FileConfig) ShouldIgnoreFile

func (c *FileConfig) ShouldIgnoreFile(filename string) bool

ShouldIgnoreFile checks if a file should be ignored based on ignore patterns

type PathRule

type PathRule struct {
	Path             string `yaml:"path"`
	SeverityOverride string `yaml:"severity_override,omitempty"` // "suggestion", "warning", "critical"
	ExtraRules       string `yaml:"extra_rules,omitempty"`       // Additional rules as text
	Ignore           bool   `yaml:"ignore,omitempty"`            // Ignore files matching this path
}

PathRule defines rules for specific file paths

type ReviewConfig

type ReviewConfig struct {
	AutoApproveThreshold int  `yaml:"auto_approve_threshold"`
	BlockOnCritical      bool `yaml:"block_on_critical"`
}

ReviewConfig contains review-specific settings

Jump to

Keyboard shortcuts

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