From 6f0be0f4d8df2e39ada0f1d1c9454f7cc1980f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Uzna=C5=84ski?= Date: Tue, 26 Mar 2024 00:49:55 +0100 Subject: [PATCH] Move all tooling configuration to config dir --- composer.json | 19 ++++++++-------- .eslintrc.json => config/js/.eslintrc.json | 0 .../js/stylelint.config.js | 0 .../php/.php-cs-fixer.php | 0 phpcs.xml => config/php/phpcs.xml | 0 .../php/phpstan-baseline.neon | 0 phpstan.neon => config/php/phpstan.neon | 22 +++++++++---------- .../tests}/FunctionalTests.xml | 0 {Configuration => config/tests}/UnitTests.xml | 0 .../typoscript}/TsLint.yml | 0 10 files changed, 21 insertions(+), 20 deletions(-) rename .eslintrc.json => config/js/.eslintrc.json (100%) rename stylelint.config.js => config/js/stylelint.config.js (100%) rename .php-cs-fixer.php => config/php/.php-cs-fixer.php (100%) rename phpcs.xml => config/php/phpcs.xml (100%) rename phpstan-baseline.neon => config/php/phpstan-baseline.neon (100%) rename phpstan.neon => config/php/phpstan.neon (66%) rename {Configuration => config/tests}/FunctionalTests.xml (100%) rename {Configuration => config/tests}/UnitTests.xml (100%) rename {Configuration => config/typoscript}/TsLint.yml (100%) diff --git a/composer.json b/composer.json index 91fc5f2a..7e019f38 100644 --- a/composer.json +++ b/composer.json @@ -121,7 +121,7 @@ "ci:coverage:functional": [ "@ci:tests:create-directories", "@coverage:create-directories", - ".Build/bin/phpunit -c ./Configuration/FunctionalTests.xml --whitelist Classes --coverage-php=.Build/coverage/functional.cov Tests/Functional" + ".Build/bin/phpunit -c ./config/tests/FunctionalTests.xml --whitelist Classes --coverage-php=.Build/coverage/functional.cov Tests/Functional" ], "ci:coverage:merge": [ "@coverage:create-directories", @@ -129,7 +129,7 @@ ], "ci:coverage:unit": [ "@coverage:create-directories", - ".Build/bin/phpunit -c ./Configuration/UnitTests.xml --whitelist Classes --coverage-php=.Build/coverage/unit.cov Tests/Unit" + ".Build/bin/phpunit -c ./config/tests/UnitTests.xml --whitelist Classes --coverage-php=.Build/coverage/unit.cov Tests/Unit" ], "ci:json:lint": "find . ! -path '*/.cache/*' ! -path '*/.Build/*' ! -path '*/node_modules/*' -name '*.json' | xargs -r php .Build/bin/jsonlint -q", "ci:php": [ @@ -138,10 +138,10 @@ "@ci:php:sniff", "@ci:php:stan" ], - "ci:php:cs-fixer": "php-cs-fixer fix --config .php-cs-fixer.php -v --dry-run --diff", + "ci:php:cs-fixer": "php-cs-fixer fix --config config/php/.php-cs-fixer.php -v --dry-run --diff", "ci:php:lint": "find .*.php *.php Classes Configuration Tests -name '*.php' -print0 | xargs -r -0 -n 1 -P 4 php -l", - "ci:php:sniff": "phpcs Classes Configuration Tests", - "ci:php:stan": "phpstan --no-progress", + "ci:php:sniff": "phpcs --standard=config/php/phpcs.xml Classes Configuration Tests", + "ci:php:stan": ".Build/bin/phpstan analyse -c config/php/phpstan.neon --no-progress", "ci:static": [ "@ci:composer:normalize", "@ci:json:lint", @@ -155,10 +155,10 @@ "ci:tests:create-directories": "mkdir -p .Build/public/typo3temp/var/tests", "ci:tests:functional": [ "@ci:tests:create-directories", - "find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo \"Running functional test suite {}\"; .Build/bin/phpunit -c ./Configuration/FunctionalTests.xml {}';" + "find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo \"Running functional test suite {}\"; .Build/bin/phpunit -c ./config/tests/FunctionalTests.xml {}';" ], "ci:tests:unit": ".Build/bin/phpunit -c ./Configuration/UnitTests.xml Tests/Unit", - "ci:ts:lint": "typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript", + "ci:ts:lint": "typoscript-lint -c config/typoscript/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript", "ci:xliff:lint": "php Build/bin/console lint:xliff Resources/Private/Language", "ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*node_modules/*' -regextype egrep -regex '.*.ya?ml$' | xargs -r php ./.Build/bin/yaml-lint", "coverage:create-directories": "mkdir -p .Build/logs .Build/coverage", @@ -175,15 +175,16 @@ "@fix:php:cs", "@fix:php:sniff" ], - "fix:php:cs": "php-cs-fixer fix --config .php-cs-fixer.php", + "fix:php:cs": "php-cs-fixer fix --config config/.php-cs-fixer.php", "fix:php:sniff": "phpcbf Classes Configuration Tests", - "phpstan:baseline": ".Build/bin/phpstan --generate-baseline --allow-empty-baseline", + "phpstan:baseline": ".Build/bin/phpstan -c config/php/phpstan-baseline.neon --generate-baseline --allow-empty-baseline", "prepare-release": [ "rm -rf .Build", "rm -rf .ddev", "rm -rf .github", "rm -rf .gitlab", "rm -rf Build", + "rm -rf config", "rm -rf Tests", "rm -rf tools", "rm .editorconfig", diff --git a/.eslintrc.json b/config/js/.eslintrc.json similarity index 100% rename from .eslintrc.json rename to config/js/.eslintrc.json diff --git a/stylelint.config.js b/config/js/stylelint.config.js similarity index 100% rename from stylelint.config.js rename to config/js/stylelint.config.js diff --git a/.php-cs-fixer.php b/config/php/.php-cs-fixer.php similarity index 100% rename from .php-cs-fixer.php rename to config/php/.php-cs-fixer.php diff --git a/phpcs.xml b/config/php/phpcs.xml similarity index 100% rename from phpcs.xml rename to config/php/phpcs.xml diff --git a/phpstan-baseline.neon b/config/php/phpstan-baseline.neon similarity index 100% rename from phpstan-baseline.neon rename to config/php/phpstan-baseline.neon diff --git a/phpstan.neon b/config/php/phpstan.neon similarity index 66% rename from phpstan.neon rename to config/php/phpstan.neon index cf89e5a0..60c66c24 100644 --- a/phpstan.neon +++ b/config/php/phpstan.neon @@ -1,9 +1,9 @@ includes: - phpstan-baseline.neon - - .Build/vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon - - .Build/vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon - - .Build/vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon - - .Build/vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon + - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon + - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon + - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon + - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon parameters: parallel: @@ -13,17 +13,17 @@ parameters: level: 3 bootstrapFiles: - - .Build/vendor/autoload.php + - ../../.Build/vendor/autoload.php paths: - - Classes - - Configuration - - Tests + - ../../Classes + - ../../Configuration + - ../../Tests scanDirectories: - - Classes - - Configuration - - Tests + - ../../Classes + - ../../Configuration + - ../../Tests type_coverage: return_type: 100 diff --git a/Configuration/FunctionalTests.xml b/config/tests/FunctionalTests.xml similarity index 100% rename from Configuration/FunctionalTests.xml rename to config/tests/FunctionalTests.xml diff --git a/Configuration/UnitTests.xml b/config/tests/UnitTests.xml similarity index 100% rename from Configuration/UnitTests.xml rename to config/tests/UnitTests.xml diff --git a/Configuration/TsLint.yml b/config/typoscript/TsLint.yml similarity index 100% rename from Configuration/TsLint.yml rename to config/typoscript/TsLint.yml