From 70ade44b5fc36069369f94e83a26ddf26755217f Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Fri, 11 Jul 2025 18:20:16 +0200 Subject: [PATCH] Added .editorconfig files --- config/drupal-module/.editorconfig | 27 +++++++++++++++++++++++++++ config/drupal/.editorconfig | 24 ++++++++++++++++++++++++ config/symfony/.editorconfig | 24 ++++++++++++++++++++++++ task/scripts/github-actions-link | 15 +++++++++++++++ templates/drupal-10/.editorconfig | 1 + templates/drupal-11/.editorconfig | 1 + templates/drupal-7/.editorconfig | 1 + templates/drupal-8/.editorconfig | 1 + templates/drupal-9/.editorconfig | 1 + templates/drupal-module/.editorconfig | 1 + templates/symfony-3/.editorconfig | 1 + templates/symfony-4/.editorconfig | 1 + templates/symfony-6/.editorconfig | 1 + 13 files changed, 99 insertions(+) create mode 100644 config/drupal-module/.editorconfig create mode 100644 config/drupal/.editorconfig create mode 100644 config/symfony/.editorconfig create mode 120000 templates/drupal-10/.editorconfig create mode 120000 templates/drupal-11/.editorconfig create mode 120000 templates/drupal-7/.editorconfig create mode 120000 templates/drupal-8/.editorconfig create mode 120000 templates/drupal-9/.editorconfig create mode 120000 templates/drupal-module/.editorconfig create mode 120000 templates/symfony-3/.editorconfig create mode 120000 templates/symfony-4/.editorconfig create mode 120000 templates/symfony-6/.editorconfig diff --git a/config/drupal-module/.editorconfig b/config/drupal-module/.editorconfig new file mode 100644 index 0000000..96c12d6 --- /dev/null +++ b/config/drupal-module/.editorconfig @@ -0,0 +1,27 @@ +# This file is copied from config/drupal-module/.editorconfig in https://github.com/itk-dev/devops_itkdev-docker. +# Feel free to edit the file, but consider making a pull request if you find a general issue with the file. + +# EditorConfig is awesome: https://editorconfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = LF +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{js,css,scss}] +indent_size = 2 + +[*.{yml,yaml}] +indent_size = 2 + +[config/sync/**/*.{yml,yaml}] +indent_size = 2 + +[*.{php,install,module,theme}] +indent_size = 2 diff --git a/config/drupal/.editorconfig b/config/drupal/.editorconfig new file mode 100644 index 0000000..bdb2316 --- /dev/null +++ b/config/drupal/.editorconfig @@ -0,0 +1,24 @@ +# This file is copied from config/drupal/.editorconfig in https://github.com/itk-dev/devops_itkdev-docker. +# Feel free to edit the file, but consider making a pull request if you find a general issue with the file. + +# EditorConfig is awesome: https://editorconfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = LF +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{js,css,scss}] +indent_size = 2 + +[*.{yml,yaml}] +indent_size = 2 + +[web/*/custom/**/*.{php,install,module,theme}] +indent_size = 2 diff --git a/config/symfony/.editorconfig b/config/symfony/.editorconfig new file mode 100644 index 0000000..8f37feb --- /dev/null +++ b/config/symfony/.editorconfig @@ -0,0 +1,24 @@ +# This file is copied from config/symfony/.editorconfig in https://github.com/itk-dev/devops_itkdev-docker. +# Feel free to edit the file, but consider making a pull request if you find a general issue with the file. + +# EditorConfig is awesome: https://editorconfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = LF +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{js,css,scss}] +indent_size = 2 + +[*.{yml,yaml}] +indent_size = 2 + +[config/**/*.{yml,yaml}] +indent_size = 4 diff --git a/task/scripts/github-actions-link b/task/scripts/github-actions-link index e7ec275..6c732ff 100755 --- a/task/scripts/github-actions-link +++ b/task/scripts/github-actions-link @@ -38,6 +38,21 @@ for template_dir in templates/*; do exit 1 fi + # General config files. + # We first check for files on the config folder and then we check for project + # specific files (in effect letting projects override the general config + # files). + for config_dir in config "config/$project_type"; do + echo "$config_dir" + # Some config files are hidden + GLOBIGNORE=".:.." + for config_file in "$config_dir"/*; do + if [ -f "$config_file" ]; then + ln -sf "../../$config_file" "$template_dir/" + fi + done + done + for f in $(find github/workflows/ -name '*.yaml' | sort); do source_file_name='' # Note: / is NOT a regex delimiter here, but an actual /, i.e. a directory separator. diff --git a/templates/drupal-10/.editorconfig b/templates/drupal-10/.editorconfig new file mode 120000 index 0000000..077ed38 --- /dev/null +++ b/templates/drupal-10/.editorconfig @@ -0,0 +1 @@ +../../config/drupal/.editorconfig \ No newline at end of file diff --git a/templates/drupal-11/.editorconfig b/templates/drupal-11/.editorconfig new file mode 120000 index 0000000..077ed38 --- /dev/null +++ b/templates/drupal-11/.editorconfig @@ -0,0 +1 @@ +../../config/drupal/.editorconfig \ No newline at end of file diff --git a/templates/drupal-7/.editorconfig b/templates/drupal-7/.editorconfig new file mode 120000 index 0000000..077ed38 --- /dev/null +++ b/templates/drupal-7/.editorconfig @@ -0,0 +1 @@ +../../config/drupal/.editorconfig \ No newline at end of file diff --git a/templates/drupal-8/.editorconfig b/templates/drupal-8/.editorconfig new file mode 120000 index 0000000..077ed38 --- /dev/null +++ b/templates/drupal-8/.editorconfig @@ -0,0 +1 @@ +../../config/drupal/.editorconfig \ No newline at end of file diff --git a/templates/drupal-9/.editorconfig b/templates/drupal-9/.editorconfig new file mode 120000 index 0000000..077ed38 --- /dev/null +++ b/templates/drupal-9/.editorconfig @@ -0,0 +1 @@ +../../config/drupal/.editorconfig \ No newline at end of file diff --git a/templates/drupal-module/.editorconfig b/templates/drupal-module/.editorconfig new file mode 120000 index 0000000..1a51611 --- /dev/null +++ b/templates/drupal-module/.editorconfig @@ -0,0 +1 @@ +../../config/drupal-module/.editorconfig \ No newline at end of file diff --git a/templates/symfony-3/.editorconfig b/templates/symfony-3/.editorconfig new file mode 120000 index 0000000..58a4295 --- /dev/null +++ b/templates/symfony-3/.editorconfig @@ -0,0 +1 @@ +../../config/symfony/.editorconfig \ No newline at end of file diff --git a/templates/symfony-4/.editorconfig b/templates/symfony-4/.editorconfig new file mode 120000 index 0000000..58a4295 --- /dev/null +++ b/templates/symfony-4/.editorconfig @@ -0,0 +1 @@ +../../config/symfony/.editorconfig \ No newline at end of file diff --git a/templates/symfony-6/.editorconfig b/templates/symfony-6/.editorconfig new file mode 120000 index 0000000..58a4295 --- /dev/null +++ b/templates/symfony-6/.editorconfig @@ -0,0 +1 @@ +../../config/symfony/.editorconfig \ No newline at end of file