mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-09 23:36:12 +01:00

[TASK] Move most development tools from PHIVE to Composer (#282)

We now only use PHIVE for those tools that are not compatible
with the PHP versions we currently support (7.2-7.4).
This currently is only the PHP copy-paste detector
(which requires PHP >= 7.3).

This also (as a nice side effect) provides `ddev composer normalize`
out of the box.

For YAML linting, we now use the `symfony/yaml` package (which already
was installed as an indirected dependency, and which we now explicitly
require).

Fixes #274
Fixes #279
This commit is contained in:
Oliver Klee 2021-08-24 02:42:02 +02:00 committed by GitHub
parent 01c0d4b4d5
commit 20112ac115
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 32 additions and 24 deletions

View file

@ -71,16 +71,21 @@ local PHP, Composer and database), or you can use
### Development tools: Composer, PHIVE and dependency hell ### Development tools: Composer, PHIVE and dependency hell
Most development tools (e.g., PHP_CodeSniffer) are installed with To keep things simple, most development tools (e.g., PHP_CodeSniffer) are
[PHIVE](https://phar.io/), not with Composer. PHIVE packages each tool with all installed as development Composer dependencies.
its dependencies as a separate PHAR. This helps avoid dependency hell (which
means that you cannot install or upgrade some tool as the tool's dependencies
conflict with the dependencies on another library). It also allows running
versions of tools that require a PHP version that is higher than the lowest
allowed PHP version for this project.
Some tools are not available via PHIVE, e.g., the Nimut testing framework or For cases where an installation via Composer is not possible, we are using
the JSON linter. For these tools, we keep using Composer for the time being. [PHIVE](https://phar.io/). PHIVE packages each tool with all its dependencies as
a separate PHAR. This helps avoid dependency hell (which means that you cannot
install or upgrade some tool as the tool's dependencies conflict with the
dependencies on another library). It also allows running versions of tools
that require a PHP version that is higher than the lowest allowed PHP version
for this project.
Currently, this is the case for
[PHP Copy/Paste Detector (PHPCPD)](https://github.com/sebastianbergmann/phpcpd),
which requires PHP >= 7.3, which conflicts with this project's PHP version
support (we also support PHP 7.2).
### Running the code quality checks locally and in a CI environment ### Running the code quality checks locally and in a CI environment

View file

@ -36,10 +36,20 @@
}, },
"require-dev": { "require-dev": {
"codeception/codeception": "^4.1.5", "codeception/codeception": "^4.1.5",
"ergebnis/composer-normalize": "^2.15",
"friendsofphp/php-cs-fixer": "^2.19.2",
"helhum/typo3-composer-setup": "^0.5.7", "helhum/typo3-composer-setup": "^0.5.7",
"helmich/typo3-typoscript-lint": "^2.5",
"jangregor/phpstan-prophecy": "^0.8.1",
"nimut/testing-framework": "^5.0.3", "nimut/testing-framework": "^5.0.3",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^0.12.96",
"phpstan/phpstan-phpunit": "^0.12.22",
"phpunit/phpunit": "^7.5.20", "phpunit/phpunit": "^7.5.20",
"saschaegerer/phpstan-typo3": "^0.13.3",
"seld/jsonlint": "^1.8", "seld/jsonlint": "^1.8",
"squizlabs/php_codesniffer": "^3.6",
"symfony/yaml": "^4.4 || ^5.3",
"typo3/cms-fluid-styled-content": "^9.5 || ^10.4" "typo3/cms-fluid-styled-content": "^9.5 || ^10.4"
}, },
"config": { "config": {
@ -76,7 +86,7 @@
"ci": [ "ci": [
"@ci:static" "@ci:static"
], ],
"ci:composer:normalize": "@php ./tools/composer-normalize --dry-run", "ci:composer:normalize": "@composer normalize --dry-run",
"ci:dynamic": [ "ci:dynamic": [
"@ci:tests" "@ci:tests"
], ],
@ -89,10 +99,10 @@
"@ci:php:stan" "@ci:php:stan"
], ],
"ci:php:copypaste": "@php ./tools/phpcpd Classes Configuration Tests", "ci:php:copypaste": "@php ./tools/phpcpd Classes Configuration Tests",
"ci:php:cs-fixer": "@php ./tools/php-cs-fixer fix --config .php_cs.php -v --dry-run --using-cache false --diff --diff-format=udiff", "ci:php:cs-fixer": "php-cs-fixer fix --config .php_cs.php -v --dry-run --using-cache false --diff --diff-format=udiff",
"ci:php:lint": "find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l", "ci:php:lint": "find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l",
"ci:php:sniff": "@php ./tools/phpcs Classes Configuration Tests", "ci:php:sniff": "phpcs Classes Configuration Tests",
"ci:php:stan": "@php ./tools/phpstan analyse Classes", "ci:php:stan": "phpstan analyse Classes",
"ci:static": [ "ci:static": [
"@ci:composer:normalize", "@ci:composer:normalize",
"@ci:json:lint", "@ci:json:lint",
@ -110,8 +120,8 @@
], ],
"ci:tests:functional": "find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo \"Running functional test suite {}\"; .Build/vendor/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml {}';", "ci:tests:functional": "find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo \"Running functional test suite {}\"; .Build/vendor/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml {}';",
"ci:tests:unit": ".Build/vendor/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/UnitTests.xml Tests/Unit", "ci:tests:unit": ".Build/vendor/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/UnitTests.xml Tests/Unit",
"ci:ts:lint": "@php ./tools/typo3-typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript", "ci:ts:lint": "typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript",
"ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*Resources/Private/node_modules/*' -name '*.yml' | xargs php ./tools/yaml-lint", "ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*Resources/Private/node_modules/*' -name '*.yml' | xargs php ./.Build/vendor/bin/yaml-lint",
"docs:generate": [ "docs:generate": [
"docker run --rm t3docs/render-documentation show-shell-commands > tempfile.sh; echo 'dockrun_t3rd makehtml' >> tempfile.sh; bash tempfile.sh; rm tempfile.sh" "docker run --rm t3docs/render-documentation show-shell-commands > tempfile.sh; echo 'dockrun_t3rd makehtml' >> tempfile.sh; bash tempfile.sh; rm tempfile.sh"
], ],
@ -119,8 +129,8 @@
"@fix:php:cs", "@fix:php:cs",
"@fix:php:sniff" "@fix:php:sniff"
], ],
"fix:php:cs": "@php ./tools/php-cs-fixer fix --config .php_cs.php", "fix:php:cs": "php-cs-fixer fix --config .php_cs.php",
"fix:php:sniff": "@php ./tools/phpcbf Classes Configuration Tests", "fix:php:sniff": "phpcbf Classes Configuration Tests",
"link-extension": [ "link-extension": [
"@php -r 'is_dir($extFolder=__DIR__.\"/.Build/public/typo3conf/ext/\") || mkdir($extFolder, 0777, true);'", "@php -r 'is_dir($extFolder=__DIR__.\"/.Build/public/typo3conf/ext/\") || mkdir($extFolder, 0777, true);'",
"@php -r 'file_exists($extFolder=__DIR__.\"/.Build/public/typo3conf/ext/tea\") || symlink(__DIR__,$extFolder);'" "@php -r 'file_exists($extFolder=__DIR__.\"/.Build/public/typo3conf/ext/tea\") || symlink(__DIR__,$extFolder);'"

View file

@ -2,11 +2,4 @@
<phive xmlns="https://phar.io/phive"> <phive xmlns="https://phar.io/phive">
<phar name="phar-io/phive" version="^0.14.5" installed="0.14.5" location="./tools/phive" copy="true"/> <phar name="phar-io/phive" version="^0.14.5" installed="0.14.5" location="./tools/phive" copy="true"/>
<phar name="phpcpd" version="^6.0.3" installed="6.0.3" location="./tools/phpcpd" copy="true"/> <phar name="phpcpd" version="^6.0.3" installed="6.0.3" location="./tools/phpcpd" copy="true"/>
<phar name="phpcs" version="^3.5.8" installed="3.5.8" location="./tools/phpcs" copy="true"/>
<phar name="phpcbf" version="^3.6.0" installed="3.6.0" location="./tools/phpcbf" copy="true"/>
<phar name="ergebnis/composer-normalize" version="^2.13.2" installed="2.13.2" location="./tools/composer-normalize" copy="true"/>
<phar name="friendsofphp/php-cs-fixer" version="^2.18.2" installed="2.18.2" location="./tools/php-cs-fixer" copy="true"/>
<phar name="j13k/yaml-lint" version="^1.1.4" installed="1.1.4" location="./tools/yaml-lint" copy="true"/>
<phar name="martin-helmich/typo3-typoscript-lint" version="^2.4.1" installed="2.4.1" location="./tools/typo3-typoscript-lint" copy="true"/>
<phar name="phpstan" version="^0.12.81" installed="0.12.81" location="./tools/phpstan" copy="true"/>
</phive> </phive>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.