# このプロジェクトで利用されるテキストファイルのスタイルルール。
# 全てのチェックインされるテキストファイルはこれらのルールに従う必要がある。
# <https://editorconfig.org/>
#
# SPDX-License-Identifier: MPL-2.0
# Copyright 2026 Shota FUJI
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

root = true

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

[*.md]
# Markdown では末尾スペース 2 つが改行として扱われる。
trim_trailing_whitespace = true
# dprint の Markdown プラグインが 4 スペースしか指定できない欠陥があるため。
# TODO: まともなフォーマッタに切り替える。 (exec ベースの何か？)
indent_style = space
indent_size = 4

# YAML は 2 スペース以外のインデントを仕様レベルで読むことができない。
[*.{yml,yaml}]
indent_style = space
indent_size = 2

# tofu fmt は 2 スペース以外の指定ができない。
[*.tf]
indent_style = space
indent_size = 2

# Nix は複数行文字列のインデントに Tab を使うと解釈がおかしくなる
# バグがずっと存在しており治る見込みがない。
[*.nix]
indent_style = space
indent_size = 2

# Zig は正しくタブ文字を扱えない。
[*.{zig,zon}]
indent_style = space
indent_size = 4
