Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ContentDefaults ContentDefaults `yaml:"content_defaults"`
Patterns []Pattern `yaml:"patterns"`
}
Config represents the complete miso configuration structure. It defines how files are matched and which review guides are applied.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a configuration with sensible defaults. Used when no configuration file is found or as a base for new configurations.
type ContentDefaults ¶
type ContentDefaults struct {
Strategy string `yaml:"strategy"` // first_lines, full_file, smart
Lines int `yaml:"lines"` // For first_lines strategy
}
ContentDefaults defines global defaults for content scanning strategies. These settings apply when patterns don't specify their own content strategy.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser handles configuration file parsing and validation. It supports multiple configuration file formats and locations.
func NewParser ¶
func NewParser() *Parser
NewParser creates a new configuration parser with default search paths. The parser will look for configuration files in standard locations.
func (*Parser) FindConfigFile ¶
FindConfigFile searches for a configuration file in the current directory and parent directories. Returns the path to the first configuration file found, or an error if none found.
func (*Parser) Load ¶
Load attempts to load configuration from default locations. Returns the first valid configuration found, or default config if none found.
type Pattern ¶
type Pattern struct {
Name string `yaml:"name"`
Filename string `yaml:"filename"` // Regex for filename matching
Content string `yaml:"content"` // Regex for content matching
ContentStrategy string `yaml:"content_strategy"` // Override default strategy
ContentLines []int `yaml:"content_lines"` // For smart strategy: [first, last, random]
Context []string `yaml:"context"` // Guide files to use
DiffContext []string `yaml:"diff_context"` // Guide files for diff reviews
Stop bool `yaml:"stop"` // Stop evaluating further patterns
}
Pattern defines a file matching rule and associated review guides. Patterns are evaluated in order and can match based on filename, content, or both.