From f7e0a86a7fc63f0f694cb8f8fc8cbf876c2fc3f5 Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Fri, 15 Nov 2019 08:26:36 +0000 Subject: [PATCH 1/2] Change default indent to 2 Prior to 3a3e5f6, there was no default indent configured in `.editorconfig`. This changed to 4 spaces when we configured an explicit indent of 2 for Gradle files. However, this change meant that YAML files then had 4-space indents, which is valid, but the repo's YAML files typically use 2-space indents. Therefore, change the default indent to 2 (which also matches e.g. bash scripts), and configure `.java` and `.groovy` specifically to use 4-space indents. --- .editorconfig | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index 06df99495e0cf..fdecafe73a347 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,10 +7,7 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true indent_style = space -indent_size = 4 - -[*.bat] indent_size = 2 -[*.gradle] -indent_size = 2 +[*.{java,groovy}] +indent_size = 4 From 14ae546f9f23fefbfbefb97188247be1ebc78853 Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Fri, 15 Nov 2019 09:25:29 +0000 Subject: [PATCH 2/2] Remove default indent from .editorconfig Instead of applying a default indent via `.editorconfig`, explicitly set an indent size for a variety of file types. --- .editorconfig | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index fdecafe73a347..5be7b263743ef 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,7 +7,27 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true indent_style = space + +[*.gradle] +indent_size = 2 + +[*.groovy] +indent_size = 4 + +[*.java] +indent_size = 4 + +[*.json] +indent_size = 2 + +[*.py] +indent_size = 2 + +[*.sh] +indent_size = 2 + +[*.{yml,yaml}] indent_size = 2 -[*.{java,groovy}] +[*.{xsd,xml}] indent_size = 4