From eab48311b410d9e382c9f3a229dfd6a3f511a033 Mon Sep 17 00:00:00 2001 From: Alexander Nitsche Date: Wed, 14 Sep 2022 14:19:58 +0200 Subject: [PATCH 1/6] BUGFIX: Fix typos in .editorconfig --- .editorconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index dec10f9..350b72f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,7 +10,7 @@ root = true charset = utf-8 end_of_line = lf insert_final_newline = true -trim_trailing-whitespace = true +trim_trailing_whitespace = true indent_style = space indent_size = 4 quote_type = single @@ -44,7 +44,7 @@ max_line_length = 1000 [*.{note,md,edit,read}] indent_size = 2 -trim_trailing-whitespace = false +trim_trailing_whitespace = false [Makefile] indent_style = tab From 66607cc02959b9e3917c35f09ecbf5c2227e1505 Mon Sep 17 00:00:00 2001 From: Alexander Nitsche Date: Wed, 14 Sep 2022 14:19:58 +0200 Subject: [PATCH 2/6] TASK: Remove unnecessary brackets in .editorconfig --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 350b72f..f897d8f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -35,7 +35,7 @@ indent_size = 4 indent_style = tab # JSON can have longer lines -[*.{json}] +[*.json] max_line_length = 1000 [Sites.xml] From 1dcd2908a58ff61c42399d5f9cd706327241b985 Mon Sep 17 00:00:00 2001 From: Alexander Nitsche Date: Wed, 14 Sep 2022 14:19:58 +0200 Subject: [PATCH 3/6] TASK: Use simple, consistent concatenation of file paths --- .editorconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index f897d8f..eb1b27c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,12 +16,12 @@ indent_size = 4 quote_type = single # 2-space files -[{*.{yaml,yml,sh,jscsrc},package.json,.*rc}] +[{*.yaml,*.yml,*.sh,*.jscsrc,package.json,.*rc}] indent_style = space indent_size = 2 # PHP should follow the PSR-2 standard -[*.{json,php}] +[{*.json,*.php}] indent_style = space indent_size = 4 @@ -42,7 +42,7 @@ max_line_length = 1000 indent_size = 1 max_line_length = 1000 -[*.{note,md,edit,read}] +[{*.note,*.md,*.edit,*.read}] indent_size = 2 trim_trailing_whitespace = false From babe14fd77ffff6b962844dc5aa7e0cafd648b0b Mon Sep 17 00:00:00 2001 From: Alexander Nitsche Date: Wed, 14 Sep 2022 14:19:58 +0200 Subject: [PATCH 4/6] BUGFIX: Fix formatting of package.json in .editorconfig EditorConfig files are read from top to bottom and the last rules found have priority: The rules of package.json regarding indentation style and indentation size did not apply because they were overwritten by the following rules for "*.json". --- .editorconfig | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index eb1b27c..e777b84 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,7 +16,7 @@ indent_size = 4 quote_type = single # 2-space files -[{*.yaml,*.yml,*.sh,*.jscsrc,package.json,.*rc}] +[{*.yaml,*.yml,*.sh,*.jscsrc,.*rc}] indent_style = space indent_size = 2 @@ -25,6 +25,14 @@ indent_size = 2 indent_style = space indent_size = 4 +# JSON can have longer lines +[*.json] +max_line_length = 1000 + +[package.json] +indent_style = space +indent_size = 2 + # Fusion uses 4 spaces [*.fusion] indent_style = space @@ -34,10 +42,6 @@ indent_size = 4 [*.js] indent_style = tab -# JSON can have longer lines -[*.json] -max_line_length = 1000 - [Sites.xml] indent_size = 1 max_line_length = 1000 From 274790fa05f5439ccc1f4810d0f89dcdf65ae9ae Mon Sep 17 00:00:00 2001 From: Alexander Nitsche Date: Wed, 14 Sep 2022 14:19:58 +0200 Subject: [PATCH 5/6] TASK: Remove redundant rules in .editorconfig These removed rules have already been defined as default. --- .editorconfig | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.editorconfig b/.editorconfig index e777b84..60ea916 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,27 +17,15 @@ quote_type = single # 2-space files [{*.yaml,*.yml,*.sh,*.jscsrc,.*rc}] -indent_style = space indent_size = 2 -# PHP should follow the PSR-2 standard -[{*.json,*.php}] -indent_style = space -indent_size = 4 - # JSON can have longer lines [*.json] max_line_length = 1000 [package.json] -indent_style = space indent_size = 2 -# Fusion uses 4 spaces -[*.fusion] -indent_style = space -indent_size = 4 - # JS should use tabs, to reduce conflicts [*.js] indent_style = tab From 21763b64443582c6de668276f49eb08e95aed4b4 Mon Sep 17 00:00:00 2001 From: Alexander Nitsche Date: Wed, 14 Sep 2022 14:19:58 +0200 Subject: [PATCH 6/6] TASK: Adapt .editorconfig to Neos' .editorconfig Set 2 spaces as default indentation instead of 4. --- .editorconfig | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.editorconfig b/.editorconfig index 60ea916..b4972ab 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,34 +12,32 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true indent_style = space -indent_size = 4 +indent_size = 2 quote_type = single -# 2-space files -[{*.yaml,*.yml,*.sh,*.jscsrc,.*rc}] -indent_size = 2 +# PHP should follow the PSR-2 standard +[*.php] +indent_size = 4 + +# JS, SASS, HTML should use tabs, to reduce conflicts +[*.{js,scss,html}] +indent_style = tab + +# Markdown et al. use trailing whitespace for line breaks +[*.{note,md,edit,read}] +trim_trailing_whitespace = false # JSON can have longer lines [*.json] max_line_length = 1000 -[package.json] -indent_size = 2 - -# JS should use tabs, to reduce conflicts -[*.js] -indent_style = tab +# Composer uses 4 spaces itself +[composer.json] +indent_size = 4 [Sites.xml] indent_size = 1 max_line_length = 1000 -[{*.note,*.md,*.edit,*.read}] -indent_size = 2 -trim_trailing_whitespace = false - [Makefile] indent_style = tab - -[*.css.d.ts] -indent_size = 2