# editorconfig.org — keep in sync with .clang-format / Prettier / shfmt.
#
# What this file does:
#   - Enforces UTF-8, LF, final newline, and trailing-whitespace trimming
#     for every text file in the repo.
#   - Keeps Windows-only artifacts (Inno Setup scripts, batch files) on CRLF.
#   - Pins the tab-indent convention for *.plist (Apple plutil) and *.sh
#     (matches what shfmt produces in scripts/).
#
# What this file deliberately does NOT do:
#   - Set indent_style/indent_size for *.cpp / *.h — .clang-format owns
#     C/C++ formatting end-to-end.
#   - Set indent_style/indent_size for *.md / *.yml / *.json — Prettier
#     owns those.
#   - Constrain *.pro / *.pri — both tab- and space-indented files exist
#     in tests/auto/*/*.pro today; forcing one would noise up unrelated
#     diffs without changing how qmake parses the files.
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Inno Setup script ships with CRLF for the Windows installer toolchain.
[*.iss]
end_of_line = crlf

# Windows batch files ship as CRLF.
[*.bat]
end_of_line = crlf

# Windows .cmd batch files ship as CRLF (see .gitattributes: cmd.exe label
# lookup is unreliable in LF-only .cmd files).
[*.cmd]
end_of_line = crlf

# Apple plist tradition (tabs); matches what plutil and Xcode produce.
[*.plist]
indent_style = tab

# Shell scripts in scripts/ are tab-indented per shfmt.
[*.sh]
indent_style = tab

# Qt Linguist translation files are generated by qmake6/lupdate and
# synced by Weblate. We don't hand-edit them; trailing whitespace and
# final-newline state come straight from those tools. The exclusion
# is also mirrored in `.ecrc` so editorconfig-checker (super-linter)
# skips them at the path level — some checker versions don't honour a
# section-level override against the [*] defaults.
[*.ts]
trim_trailing_whitespace = unset
insert_final_newline = unset
end_of_line = unset
