# Taplo configuration for TOML formatting and linting
# https://taplo.tamasfe.dev/configuration/

[formatting]
# Indent tables with 2 spaces
indent_string = "  "
indent_tables = true

# Reorder keys alphabetically within tables
reorder_keys = true

# Reorder arrays to be more readable
reorder_arrays = false

# Align entries vertically in inline tables
align_entries = false

# Allow compact inline tables
allowed_blank_lines = 1

# Trailing newline
trailing_newline = true

# Column width for wrapping
column_width = 100

# Compact arrays
compact_arrays = true

# Compact inline tables
compact_inline_tables = false

# === INCLUDE/EXCLUDE PATTERNS ===

include = ["Cargo.toml", "*/Cargo.toml", "config/**/*.toml", "**/*.toml"]

exclude = ["target/**", "node_modules/**", ".git/**"]

# === SCHEMA VALIDATION ===

# Cargo.toml schema validation
[[rule]]
include = ["**/Cargo.toml"]
# Taplo includes built-in Cargo.toml schema

# Form definition TOML files (custom schema could be added)
[[rule]]
include = ["config/**/forms/*.toml", "tests/fixtures/**/*.toml"]
keys = ["name", "description", "fields", "items", "elements"]
