# ABOUTME: EditorConfig for Go projects
# ABOUTME: Enforces consistent formatting across editors

# Top-most EditorConfig file
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

# Go files - tabs as per gofmt
[*.go]
indent_style = tab
indent_size = 4
tab_width = 4

# Go module files
[go.mod]
indent_style = tab
indent_size = 4
tab_width = 4

[go.sum]
indent_style = tab
indent_size = 4
tab_width = 4

# Makefiles require tabs
[Makefile]
indent_style = tab
indent_size = 4
tab_width = 4

[*.mk]
indent_style = tab
indent_size = 4
tab_width = 4

# YAML files
[*.{yml,yaml}]
indent_style = space
indent_size = 2

# JSON files
[*.json]
indent_style = space
indent_size = 2

# Markdown files
[*.md]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2

# Shell scripts
[*.sh]
indent_style = space
indent_size = 4

# Protocol Buffers
[*.proto]
indent_style = space
indent_size = 2

# TOML files
[*.toml]
indent_style = space
indent_size = 2

# SQL files
[*.sql]
indent_style = space
indent_size = 2

# Docker files
[Dockerfile*]
indent_style = space
indent_size = 4

# Git files
[.git*]
indent_style = space
indent_size = 2
