diff --git a/.editorconfig b/.editorconfig index 59bf406..be76d7c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,14 +2,17 @@ root=true [*] charset = utf-8 end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{json,yaml,yml,tf}] +indent_size = 2 + +[*.php] ij_continuation_indent_size = 4 indent_size = 4 indent_style = space -insert_final_newline = true tab_width = 4 -trim_trailing_whitespace = true - -[{*.php}] 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..be76d7c 100644 --- a/dist/.editorconfig.dist +++ b/dist/.editorconfig.dist @@ -2,14 +2,17 @@ root=true [*] charset = utf-8 end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{json,yaml,yml,tf}] +indent_size = 2 + +[*.php] ij_continuation_indent_size = 4 indent_size = 4 indent_style = space -insert_final_newline = true tab_width = 4 -trim_trailing_whitespace = true - -[{*.php}] 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/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