From 7d78c8ae5bdcd8f0c6134179b1ebf0515ad85b9d Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Mon, 27 Nov 2023 16:36:56 +0100 Subject: [PATCH] [WIP][TASK] Add editor config linting WIP: * Add GitLab and GitHub Jobs Resolves: #498 --- .editorconfig | 9 ++------- .gitattributes | 1 + Documentation/Includes.rst.txt | 2 +- Documentation/TestingFramework.rst | 1 - composer.json | 3 +++ ec-cli-config.php | 17 +++++++++++++++++ 6 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 ec-cli-config.php diff --git a/.editorconfig b/.editorconfig index 4a8657c..c58ebcb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -25,12 +25,11 @@ indent_size = 2 # ReST files [{*.rst,*.rst.txt}] indent_size = 4 -max_line_length = 80 # SQL files [*.sql] -indent_style = tab -indent_size = 2 +indent_style = space +indent_size = 4 # TypoScript files [*.{typoscript,tsconfig}] @@ -47,7 +46,3 @@ indent_style = tab # .htaccess [.htaccess] indent_style = tab - -# Markdown files -[*.md] -max_line_length = 80 diff --git a/.gitattributes b/.gitattributes index 0620665..272255b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,6 +12,7 @@ /.prettierrc.js export-ignore /Build/ export-ignore /Tests/ export-ignore +/ec-cli-config.php export-ignore /package.json export-ignore /phive.xml export-ignore /phpcs.xml export-ignore diff --git a/Documentation/Includes.rst.txt b/Documentation/Includes.rst.txt index 1f85da4..de47271 100644 --- a/Documentation/Includes.rst.txt +++ b/Documentation/Includes.rst.txt @@ -1,4 +1,4 @@ -.. More information about this file: +.. More information about this file: https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/GeneralConventions/FileStructure.html#includes-rst-txt .. ---------- diff --git a/Documentation/TestingFramework.rst b/Documentation/TestingFramework.rst index 1cdd068..9bc2de3 100644 --- a/Documentation/TestingFramework.rst +++ b/Documentation/TestingFramework.rst @@ -54,4 +54,3 @@ code changes) more of a hassle. For this approach, the `TYPO3 testing framework `__ - which supports only one TYPO3 LTS version at a time - will work just fine. - diff --git a/composer.json b/composer.json index 192c3b6..4d53c9f 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,7 @@ "typo3/cms-frontend": "^11.5.4 || ^12.4" }, "require-dev": { + "armin/editorconfig-cli": "^1.7", "doctrine/dbal": "^2.13.5 || ^3.6.2", "ergebnis/composer-normalize": "^2.28.3", "friendsofphp/php-cs-fixer": "^3.40.0", @@ -133,6 +134,7 @@ "ci:dynamic": [ "@ci:tests" ], + "ci:editorconfig:lint": "ec --finder-config ec-cli-config.php", "ci:json:lint": "find . ! -path '*.Build/*' ! -path '*node_modules/*' -name '*.json' | xargs -r php .Build/bin/jsonlint -q", "ci:php": [ "@ci:php:cs-fixer", @@ -210,6 +212,7 @@ "ci:coverage:merge": "Merges the code coverage reports for unit and functional tests.", "ci:coverage:unit": "Generates the code coverage report for unit tests.", "ci:dynamic": "Runs all PHPUnit tests (unit and functional).", + "ci:editorconfig:lint": "Lints files based on editorconfig.", "ci:json:lint": "Lints the JSON files.", "ci:php": "Runs all static checks for the PHP files.", "ci:php:cs-fixer": "Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer).", diff --git a/ec-cli-config.php b/ec-cli-config.php new file mode 100644 index 0000000..53a2725 --- /dev/null +++ b/ec-cli-config.php @@ -0,0 +1,17 @@ +in(__DIR__) + ->notPath('tools') + ->notPath('.Build') + ->notPath('var') + ->notPath('Documentation-GENERATED-temp') + ->notName('phpstan-baseline.neon') +; + +return $finder;