From cc513968eafe6ce1d98fad59b722570c3747e9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20Pa=CC=81ll?= Date: Tue, 9 Sep 2025 15:48:11 +0200 Subject: [PATCH 1/2] KUNGBE-256 Move indentation rules to *.php --- .editorconfig | 8 ++++---- dist/.editorconfig.dist | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.editorconfig b/.editorconfig index 59bf406..84aebc2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,14 +2,14 @@ root=true [*] charset = utf-8 end_of_line = lf -ij_continuation_indent_size = 4 -indent_size = 4 -indent_style = space insert_final_newline = true -tab_width = 4 trim_trailing_whitespace = true [{*.php}] +ij_continuation_indent_size = 4 +indent_size = 4 +indent_style = space +tab_width = 4 ij_php_align_key_value_pairs = true ij_php_align_multiline_array_initializer_expression = true ij_php_align_multiline_chained_methods = true diff --git a/dist/.editorconfig.dist b/dist/.editorconfig.dist index 59bf406..84aebc2 100644 --- a/dist/.editorconfig.dist +++ b/dist/.editorconfig.dist @@ -2,14 +2,14 @@ root=true [*] charset = utf-8 end_of_line = lf -ij_continuation_indent_size = 4 -indent_size = 4 -indent_style = space insert_final_newline = true -tab_width = 4 trim_trailing_whitespace = true [{*.php}] +ij_continuation_indent_size = 4 +indent_size = 4 +indent_style = space +tab_width = 4 ij_php_align_key_value_pairs = true ij_php_align_multiline_array_initializer_expression = true ij_php_align_multiline_chained_methods = true From a9587e61dbb4817ab82b82b7612d28fec1feb494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20Pa=CC=81ll?= Date: Tue, 9 Sep 2025 17:08:27 +0200 Subject: [PATCH 2/2] KUNGBE-256 Add indent for config files & extend readme with usage --- .editorconfig | 5 ++++- dist/.editorconfig.dist | 5 ++++- docs/EditorConfig/README.md | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 84aebc2..be76d7c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,10 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -[{*.php}] +[*.{json,yaml,yml,tf}] +indent_size = 2 + +[*.php] ij_continuation_indent_size = 4 indent_size = 4 indent_style = space diff --git a/dist/.editorconfig.dist b/dist/.editorconfig.dist index 84aebc2..be76d7c 100644 --- a/dist/.editorconfig.dist +++ b/dist/.editorconfig.dist @@ -5,7 +5,10 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -[{*.php}] +[*.{json,yaml,yml,tf}] +indent_size = 2 + +[*.php] ij_continuation_indent_size = 4 indent_size = 4 indent_style = space diff --git a/docs/EditorConfig/README.md b/docs/EditorConfig/README.md index 61902ab..095400d 100644 --- a/docs/EditorConfig/README.md +++ b/docs/EditorConfig/README.md @@ -13,6 +13,14 @@ This helps: - Maintain clean and readable code - Standardize formatting across different team members' environments +## 🎛️ Usage + +To enable it just copy the `.editorconfig` file to your repository root (or use the `vendor/bin/code-tools publish:config editorconfig` command). + +For PHPStorm you can find the instruction [here](https://www.jetbrains.com/help/phpstorm/editorconfig.html). + +Alternatively you can go to `Settings -> Editor -> Code Style -> PHP -> Scheme -> ⚙️ -> Import Scheme...` and import the `.editorconfig` file as inspection settings without the need to add the file to the repository. + ## ⚙️ Sample .editorconfig ```ini