config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConfigFile

func FindConfigFile() string

FindConfigFile searches for a quality config file in the current directory and up the directory tree.

func SaveConfig

func SaveConfig(config *Config, configPath string) error

SaveConfig saves configuration to file.

Types

type Config

type Config struct {
	// DefaultWorkers sets the default number of parallel workers
	DefaultWorkers int `yaml:"default_workers"`

	// Timeout sets the default timeout for tool execution
	Timeout string `yaml:"timeout"`

	// Tools contains tool-specific configurations
	Tools map[string]ToolConfig `yaml:"tools"`

	// Languages contains language-specific configurations
	Languages map[string]LanguageConfig `yaml:"languages"`

	// Exclude contains patterns to exclude from processing
	Exclude []string `yaml:"exclude"`

	// Include contains patterns to include in processing
	Include []string `yaml:"include"`
}

Config represents the quality command configuration.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration.

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

LoadConfig loads configuration from file.

func (*Config) GetLanguageConfig

func (c *Config) GetLanguageConfig(language string) LanguageConfig

GetLanguageConfig returns configuration for a specific language.

func (*Config) GetPreferredTools

func (c *Config) GetPreferredTools(language string) []string

GetPreferredTools returns preferred tools for a language.

func (*Config) GetToolConfig

func (c *Config) GetToolConfig(toolName string) ToolConfig

GetToolConfig returns configuration for a specific tool.

func (*Config) IsLanguageEnabled

func (c *Config) IsLanguageEnabled(language string) bool

IsLanguageEnabled checks if a language is enabled.

func (*Config) IsToolEnabled

func (c *Config) IsToolEnabled(toolName string) bool

IsToolEnabled checks if a tool is enabled.

func (*Config) ShouldExclude

func (c *Config) ShouldExclude(filePath string) bool

ShouldExclude checks if a file path should be excluded.

func (*Config) ShouldInclude

func (c *Config) ShouldInclude(filePath string) bool

ShouldInclude checks if a file path should be included.

type LanguageConfig

type LanguageConfig struct {
	// Enabled controls whether to process this language
	Enabled bool `yaml:"enabled"`

	// PreferredTools lists preferred tools for this language
	PreferredTools []string `yaml:"preferred_tools"`

	// Extensions lists file extensions for this language
	Extensions []string `yaml:"extensions"`
}

LanguageConfig represents configuration for a language.

type ToolConfig

type ToolConfig struct {
	// Enabled controls whether the tool should be used
	Enabled bool `yaml:"enabled"`

	// ConfigFile specifies a custom config file path
	ConfigFile string `yaml:"config_file"`

	// Args contains additional arguments to pass to the tool
	Args []string `yaml:"args"`

	// Env contains environment variables for the tool
	Env map[string]string `yaml:"env"`

	// Priority affects execution order (higher = earlier)
	Priority int `yaml:"priority"`
}

ToolConfig represents configuration for a specific tool.

Jump to

Keyboard shortcuts

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