# https://editorconfig.org/

root = true

[*]
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

[*.conf]
indent_size = 2

[*.md]
#inside code block, indentation could be anything
indent_size = unset

[*.py]
indent_size = 4
# 88 is the default for black formatter
# 79 is PEP8's recommendation
# 119 is django's recommendation
max_line_length = 88

[*.rs]
# https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/guide.md
indent_size = 4
# officially the limit is 100, but we have long url (unsplittable) in comment
max_line_length = 200

[{*.bazel,*.bzl,BUILD,WORKSPACE}]
indent_size = 4

[*.java]
# try to align with https://github.com/diffplug/spotless (https://github.com/google/google-java-format)
indent_size = 4
max_line_length = 100

# The JSON files contain newlines inconsistently
[*.json]
insert_final_newline = unset

[**/vendor/**]
indent_style = unset
indent_size = unset
insert_final_newline = unset

# Minified JavaScript files shouldn't be changed
[**.min.js]
indent_style = unset
indent_size = unset
insert_final_newline = unset

# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab
indent_size = 4

[justfile]
indent_style = space
indent_size = 4

# Batch files use tabs for indentation
[*.bat]
indent_style = tab
indent_size = 4

[*.sh]
binary_next_line = true
switch_case_indent = true
