# EditorConfig for Workspace Template
# https://editorconfig.org
# Standardized across all repositories

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 - 4 spaces (matches shfmt -i 4 in fix.sh)
[*.{sh,bash}]
indent_size = 4

# 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

# LaTeX files
[*.{tex,sty,cls,bib}]
indent_size = 2
max_line_length = 120

# Perl files
[*.{pl,pm,t}]
indent_size = 4
max_line_length = 120

# Lua files
[*.lua]
indent_size = 2
max_line_length = 120

# HDL/VHDL/Verilog files
[*.{vhd,vhdl}]
indent_size = 2
max_line_length = 120

[*.{v,sv,svh}]
indent_size = 2
max_line_length = 120

# TCL/Tk files
[*.{tcl,tm,itcl,itk}]
indent_size = 4
max_line_length = 120

# 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
