# EditorConfig for Oscura
# https://editorconfig.org
# Standardized formatting configuration

root = true

# Default settings for all files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
max_line_length = 120

# Python files (line length matches ruff in pyproject.toml)
[*.{py,pyi}]
indent_size = 4
max_line_length = 100

# Configuration files (YAML, JSON, TOML)
[*.{yaml,yml}]
indent_size = 2

[*.{json,jsonc}]
indent_size = 2

[*.toml]
indent_size = 4

# Web files (HTML, CSS, JS, TS)
[*.{html,htm,css,js,ts,jsx,tsx}]
indent_size = 2

# Shell scripts - 2 spaces (shfmt -i 2)
[*.{sh,bash}]
indent_size = 2

# Markdown - preserve trailing whitespace for line breaks
[*.md]
indent_size = 2
trim_trailing_whitespace = false
max_line_length = 120

# Jinja2 templates
[*.j2]
indent_size = 2
trim_trailing_whitespace = false

# PlantUML diagrams
[*.{puml,plantuml,pu,iuml}]
indent_size = 2
max_line_length = 120

# XML files
[*.{xml,xsl,xslt,xsd,svg,plist,xhtml,wsdl}]
indent_size = 2
max_line_length = 120

# CSV/TSV files (no indent requirements)
[*.{csv,tsv}]
insert_final_newline = false
trim_trailing_whitespace = false

# Makefiles require tabs
[{Makefile,makefile,GNUmakefile}]
indent_style = tab

# Git config files
[.git*]
indent_size = 2

# VS Code config files
[.vscode/*.json]
indent_size = 2

# Oscura-specific configuration files
[*.oscura.{yaml,yml}]
indent_size = 2

[oscura.{yaml,yml}]
indent_size = 2
