chore: fix toml lint
This commit is contained in:
parent
3c88c8ddd4
commit
93625d6290
@ -3,158 +3,154 @@
|
|||||||
|
|
||||||
[validation_settings]
|
[validation_settings]
|
||||||
# Global validation settings
|
# Global validation settings
|
||||||
default_severity_filter = "warning"
|
auto_fix_enabled = true
|
||||||
default_report_format = "md"
|
default_report_format = "md"
|
||||||
|
default_severity_filter = "warning"
|
||||||
max_concurrent_rules = 4
|
max_concurrent_rules = 4
|
||||||
progress_reporting = true
|
progress_reporting = true
|
||||||
auto_fix_enabled = true
|
|
||||||
|
|
||||||
# Rule execution settings
|
# Rule execution settings
|
||||||
[execution]
|
[execution]
|
||||||
# Rules execution order and grouping
|
# Rules execution order and grouping
|
||||||
rule_groups = [
|
rule_groups = [
|
||||||
"syntax", # Critical syntax validation first
|
"syntax", # Critical syntax validation first
|
||||||
"compilation", # Compilation checks
|
"compilation", # Compilation checks
|
||||||
"schema", # Schema validation
|
"schema", # Schema validation
|
||||||
"security", # Security checks
|
"security", # Security checks
|
||||||
"best_practices", # Best practices
|
"best_practices", # Best practices
|
||||||
"compatibility" # Compatibility checks
|
"compatibility", # Compatibility checks
|
||||||
]
|
]
|
||||||
|
|
||||||
# Timeout settings (in seconds)
|
# Timeout settings (in seconds)
|
||||||
rule_timeout = 30
|
|
||||||
file_timeout = 10
|
file_timeout = 10
|
||||||
|
rule_timeout = 30
|
||||||
total_timeout = 300
|
total_timeout = 300
|
||||||
|
|
||||||
# Parallel processing
|
# Parallel processing
|
||||||
parallel_files = true
|
|
||||||
max_file_workers = 8
|
max_file_workers = 8
|
||||||
|
parallel_files = true
|
||||||
|
|
||||||
# Core validation rules
|
# Core validation rules
|
||||||
[[rules]]
|
[[rules]]
|
||||||
|
auto_fix = true
|
||||||
|
category = "syntax"
|
||||||
|
description = "Validate YAML files have correct syntax and can be parsed"
|
||||||
|
enabled = true
|
||||||
|
execution_order = 1
|
||||||
|
files_pattern = '.*\.ya?ml$'
|
||||||
|
fix_function = "fix_yaml_syntax"
|
||||||
id = "VAL001"
|
id = "VAL001"
|
||||||
name = "YAML Syntax Validation"
|
name = "YAML Syntax Validation"
|
||||||
description = "Validate YAML files have correct syntax and can be parsed"
|
|
||||||
category = "syntax"
|
|
||||||
severity = "critical"
|
severity = "critical"
|
||||||
enabled = true
|
|
||||||
auto_fix = true
|
|
||||||
files_pattern = '.*\.ya?ml$'
|
|
||||||
validator_function = "validate_yaml_syntax"
|
|
||||||
fix_function = "fix_yaml_syntax"
|
|
||||||
execution_order = 1
|
|
||||||
tags = ["syntax", "yaml", "critical"]
|
tags = ["syntax", "yaml", "critical"]
|
||||||
|
validator_function = "validate_yaml_syntax"
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
|
auto_fix = false
|
||||||
|
category = "compilation"
|
||||||
|
dependencies = ["kcl"] # Required system dependencies
|
||||||
|
description = "Validate KCL files compile successfully"
|
||||||
|
enabled = true
|
||||||
|
execution_order = 2
|
||||||
|
files_pattern = '.*\.k$'
|
||||||
id = "VAL002"
|
id = "VAL002"
|
||||||
name = "KCL Compilation Check"
|
name = "KCL Compilation Check"
|
||||||
description = "Validate KCL files compile successfully"
|
|
||||||
category = "compilation"
|
|
||||||
severity = "critical"
|
severity = "critical"
|
||||||
enabled = true
|
|
||||||
auto_fix = false
|
|
||||||
files_pattern = '.*\.k$'
|
|
||||||
validator_function = "validate_kcl_compilation"
|
|
||||||
execution_order = 2
|
|
||||||
tags = ["kcl", "compilation", "critical"]
|
tags = ["kcl", "compilation", "critical"]
|
||||||
dependencies = ["kcl"] # Required system dependencies
|
validator_function = "validate_kcl_compilation"
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
|
auto_fix = true
|
||||||
|
category = "syntax"
|
||||||
|
description = "Check for unquoted variable references in YAML that cause parsing errors"
|
||||||
|
enabled = true
|
||||||
|
execution_order = 3
|
||||||
|
files_pattern = '.*\.ya?ml$'
|
||||||
|
fix_function = "fix_unquoted_variables"
|
||||||
id = "VAL003"
|
id = "VAL003"
|
||||||
name = "Unquoted Variable References"
|
name = "Unquoted Variable References"
|
||||||
description = "Check for unquoted variable references in YAML that cause parsing errors"
|
|
||||||
category = "syntax"
|
|
||||||
severity = "error"
|
severity = "error"
|
||||||
enabled = true
|
|
||||||
auto_fix = true
|
|
||||||
files_pattern = '.*\.ya?ml$'
|
|
||||||
validator_function = "validate_quoted_variables"
|
|
||||||
fix_function = "fix_unquoted_variables"
|
|
||||||
execution_order = 3
|
|
||||||
tags = ["yaml", "variables", "syntax"]
|
tags = ["yaml", "variables", "syntax"]
|
||||||
|
validator_function = "validate_quoted_variables"
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
|
auto_fix = false
|
||||||
|
category = "schema"
|
||||||
|
description = "Validate that all required fields are present in configuration files"
|
||||||
|
enabled = true
|
||||||
|
execution_order = 10
|
||||||
|
files_pattern = '.*\.(k|ya?ml)$'
|
||||||
id = "VAL004"
|
id = "VAL004"
|
||||||
name = "Required Fields Validation"
|
name = "Required Fields Validation"
|
||||||
description = "Validate that all required fields are present in configuration files"
|
|
||||||
category = "schema"
|
|
||||||
severity = "error"
|
severity = "error"
|
||||||
enabled = true
|
|
||||||
auto_fix = false
|
|
||||||
files_pattern = '.*\.(k|ya?ml)$'
|
|
||||||
validator_function = "validate_required_fields"
|
|
||||||
execution_order = 10
|
|
||||||
tags = ["schema", "required", "fields"]
|
tags = ["schema", "required", "fields"]
|
||||||
|
validator_function = "validate_required_fields"
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
|
auto_fix = true
|
||||||
|
category = "best_practices"
|
||||||
|
description = "Validate resource names follow established conventions"
|
||||||
|
enabled = true
|
||||||
|
execution_order = 20
|
||||||
|
files_pattern = '.*\.(k|ya?ml)$'
|
||||||
|
fix_function = "fix_naming_conventions"
|
||||||
id = "VAL005"
|
id = "VAL005"
|
||||||
name = "Resource Naming Conventions"
|
name = "Resource Naming Conventions"
|
||||||
description = "Validate resource names follow established conventions"
|
|
||||||
category = "best_practices"
|
|
||||||
severity = "warning"
|
severity = "warning"
|
||||||
enabled = true
|
|
||||||
auto_fix = true
|
|
||||||
files_pattern = '.*\.(k|ya?ml)$'
|
|
||||||
validator_function = "validate_naming_conventions"
|
|
||||||
fix_function = "fix_naming_conventions"
|
|
||||||
execution_order = 20
|
|
||||||
tags = ["naming", "conventions", "best_practices"]
|
tags = ["naming", "conventions", "best_practices"]
|
||||||
|
validator_function = "validate_naming_conventions"
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
|
auto_fix = false
|
||||||
|
category = "security"
|
||||||
|
description = "Validate basic security configurations like SSH keys, exposed ports"
|
||||||
|
enabled = true
|
||||||
|
execution_order = 15
|
||||||
|
files_pattern = '.*\.(k|ya?ml)$'
|
||||||
id = "VAL006"
|
id = "VAL006"
|
||||||
name = "Basic Security Checks"
|
name = "Basic Security Checks"
|
||||||
description = "Validate basic security configurations like SSH keys, exposed ports"
|
|
||||||
category = "security"
|
|
||||||
severity = "error"
|
severity = "error"
|
||||||
enabled = true
|
|
||||||
auto_fix = false
|
|
||||||
files_pattern = '.*\.(k|ya?ml)$'
|
|
||||||
validator_function = "validate_security_basics"
|
|
||||||
execution_order = 15
|
|
||||||
tags = ["security", "ssh", "ports"]
|
tags = ["security", "ssh", "ports"]
|
||||||
|
validator_function = "validate_security_basics"
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
|
auto_fix = false
|
||||||
|
category = "compatibility"
|
||||||
|
description = "Check for deprecated versions and compatibility issues"
|
||||||
|
enabled = true
|
||||||
|
execution_order = 25
|
||||||
|
files_pattern = '.*\.(k|ya?ml|toml)$'
|
||||||
id = "VAL007"
|
id = "VAL007"
|
||||||
name = "Version Compatibility Check"
|
name = "Version Compatibility Check"
|
||||||
description = "Check for deprecated versions and compatibility issues"
|
|
||||||
category = "compatibility"
|
|
||||||
severity = "warning"
|
severity = "warning"
|
||||||
enabled = true
|
|
||||||
auto_fix = false
|
|
||||||
files_pattern = '.*\.(k|ya?ml|toml)$'
|
|
||||||
validator_function = "validate_version_compatibility"
|
|
||||||
execution_order = 25
|
|
||||||
tags = ["versions", "compatibility", "deprecation"]
|
tags = ["versions", "compatibility", "deprecation"]
|
||||||
|
validator_function = "validate_version_compatibility"
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
|
auto_fix = false
|
||||||
|
category = "networking"
|
||||||
|
description = "Validate network configurations, CIDR blocks, and IP assignments"
|
||||||
|
enabled = true
|
||||||
|
execution_order = 18
|
||||||
|
files_pattern = '.*\.(k|ya?ml)$'
|
||||||
id = "VAL008"
|
id = "VAL008"
|
||||||
name = "Network Configuration Validation"
|
name = "Network Configuration Validation"
|
||||||
description = "Validate network configurations, CIDR blocks, and IP assignments"
|
|
||||||
category = "networking"
|
|
||||||
severity = "error"
|
severity = "error"
|
||||||
enabled = true
|
|
||||||
auto_fix = false
|
|
||||||
files_pattern = '.*\.(k|ya?ml)$'
|
|
||||||
validator_function = "validate_network_config"
|
|
||||||
execution_order = 18
|
|
||||||
tags = ["networking", "cidr", "ip"]
|
tags = ["networking", "cidr", "ip"]
|
||||||
|
validator_function = "validate_network_config"
|
||||||
|
|
||||||
# Extension points for custom rules
|
# Extension points for custom rules
|
||||||
[extensions]
|
[extensions]
|
||||||
# Paths to search for custom validation rules
|
# Paths to search for custom validation rules
|
||||||
rule_paths = [
|
rule_paths = [
|
||||||
"./custom_rules",
|
"./custom_rules",
|
||||||
"./providers/*/validation_rules",
|
"./providers/*/validation_rules",
|
||||||
"./taskservs/*/validation_rules",
|
"./taskservs/*/validation_rules",
|
||||||
"../validation_extensions"
|
"../validation_extensions",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Custom rule file patterns
|
# Custom rule file patterns
|
||||||
rule_file_patterns = [
|
rule_file_patterns = ["*_validation_rules.toml", "validation_*.toml", "rules.toml"]
|
||||||
"*_validation_rules.toml",
|
|
||||||
"validation_*.toml",
|
|
||||||
"rules.toml"
|
|
||||||
]
|
|
||||||
|
|
||||||
# Hook system for extending validation
|
# Hook system for extending validation
|
||||||
[hooks]
|
[hooks]
|
||||||
@ -165,12 +161,12 @@ pre_validation = []
|
|||||||
post_validation = []
|
post_validation = []
|
||||||
|
|
||||||
# Per-rule hooks
|
# Per-rule hooks
|
||||||
pre_rule = []
|
|
||||||
post_rule = []
|
post_rule = []
|
||||||
|
pre_rule = []
|
||||||
|
|
||||||
# Report generation hooks
|
# Report generation hooks
|
||||||
pre_report = []
|
|
||||||
post_report = []
|
post_report = []
|
||||||
|
pre_report = []
|
||||||
|
|
||||||
# CI/CD integration settings
|
# CI/CD integration settings
|
||||||
[ci_cd]
|
[ci_cd]
|
||||||
@ -195,27 +191,27 @@ max_total_size = 100
|
|||||||
max_memory_usage = "512MB"
|
max_memory_usage = "512MB"
|
||||||
|
|
||||||
# Caching settings
|
# Caching settings
|
||||||
|
cache_duration = 3600 # seconds
|
||||||
enable_caching = true
|
enable_caching = true
|
||||||
cache_duration = 3600 # seconds
|
|
||||||
|
|
||||||
# Provider-specific rule configurations
|
# Provider-specific rule configurations
|
||||||
[providers.upcloud]
|
[providers.upcloud]
|
||||||
enabled_rules = ["VAL001", "VAL002", "VAL003", "VAL004", "VAL006", "VAL008"]
|
|
||||||
custom_rules = ["UPCLOUD001", "UPCLOUD002"]
|
custom_rules = ["UPCLOUD001", "UPCLOUD002"]
|
||||||
|
enabled_rules = ["VAL001", "VAL002", "VAL003", "VAL004", "VAL006", "VAL008"]
|
||||||
|
|
||||||
[providers.aws]
|
[providers.aws]
|
||||||
enabled_rules = ["VAL001", "VAL002", "VAL003", "VAL004", "VAL006", "VAL007", "VAL008"]
|
|
||||||
custom_rules = ["AWS001", "AWS002", "AWS003"]
|
custom_rules = ["AWS001", "AWS002", "AWS003"]
|
||||||
|
enabled_rules = ["VAL001", "VAL002", "VAL003", "VAL004", "VAL006", "VAL007", "VAL008"]
|
||||||
|
|
||||||
[providers.local]
|
[providers.local]
|
||||||
enabled_rules = ["VAL001", "VAL002", "VAL003", "VAL004", "VAL005"]
|
|
||||||
custom_rules = []
|
custom_rules = []
|
||||||
|
enabled_rules = ["VAL001", "VAL002", "VAL003", "VAL004", "VAL005"]
|
||||||
|
|
||||||
# Taskserv-specific configurations
|
# Taskserv-specific configurations
|
||||||
[taskservs.kubernetes]
|
[taskservs.kubernetes]
|
||||||
enabled_rules = ["VAL001", "VAL002", "VAL004", "VAL006", "VAL008"]
|
|
||||||
custom_rules = ["K8S001", "K8S002"]
|
custom_rules = ["K8S001", "K8S002"]
|
||||||
|
enabled_rules = ["VAL001", "VAL002", "VAL004", "VAL006", "VAL008"]
|
||||||
|
|
||||||
[taskservs.containerd]
|
[taskservs.containerd]
|
||||||
enabled_rules = ["VAL001", "VAL004", "VAL006"]
|
|
||||||
custom_rules = ["CONTAINERD001"]
|
custom_rules = ["CONTAINERD001"]
|
||||||
|
enabled_rules = ["VAL001", "VAL004", "VAL006"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user