From e5810c907ad7e81177558b30444ee4bd6d67fc34 Mon Sep 17 00:00:00 2001 From: Leo Feyer <1192057+leofeyer@users.noreply.github.com> Date: Thu, 4 Apr 2024 17:32:39 +0200 Subject: [PATCH] Remove contao/code-quality again (#27) --- .github/workflows/ci.yml | 4 ++-- composer.json | 11 ++++++----- ecs.php | 7 +++++-- rector.php | 15 +++++++++++++-- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34db360..e020480 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,10 +59,10 @@ jobs: run: composer install --no-interaction --no-progress - name: Run Rector - run: vendor/bin/rector --dry-run --no-progress-bar --ansi + run: vendor/bin/rector --dry-run --no-progress-bar - name: Run ECS - run: vendor/bin/ecs check --no-progress-bar --ansi + run: vendor/bin/ecs check --no-progress-bar - name: Run PHPStan run: vendor/bin/phpstan analyse --no-progress diff --git a/composer.json b/composer.json index 6a20079..791bb86 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,8 @@ }, "require-dev": { "ausi/remote-git": "^0.2.5", - "contao/code-quality": "^1.0", + "contao/easy-coding-standard": "^6.12", + "contao/rector": "^1.2", "phpstan/phpstan": "^1.0", "phpstan/phpstan-symfony": "^1.0", "phpunit/phpunit": "^9.5" @@ -56,9 +57,9 @@ "@unit-tests", "@phpstan" ], - "ecs": "@php vendor/bin/ecs check --fix --ansi", - "phpstan": "@php vendor/bin/phpstan analyze --ansi", - "rector": "@php vendor/bin/rector --ansi", - "unit-tests": "@php vendor/bin/phpunit --colors=always" + "ecs": "@php vendor/bin/ecs check --fix", + "phpstan": "@php vendor/bin/phpstan analyze", + "rector": "@php vendor/bin/rector", + "unit-tests": "@php vendor/bin/phpunit" } } diff --git a/ecs.php b/ecs.php index 70c2473..aa1517e 100644 --- a/ecs.php +++ b/ecs.php @@ -10,6 +10,7 @@ * @license LGPL-3.0-or-later */ +use Contao\EasyCodingStandard\Set\SetList; use PhpCsFixer\Fixer\Comment\HeaderCommentFixer; use PhpCsFixer\Fixer\Operator\NoUselessConcatOperatorFixer; use PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer; @@ -17,10 +18,12 @@ use Symplify\EasyCodingStandard\ValueObject\Option; return ECSConfig::configure() - ->withSets([__DIR__.'/vendor/contao/code-quality/config/ecs.php']) + ->withSets([SetList::CONTAO]) ->withPaths([ __DIR__.'/src', __DIR__.'/tests', + __DIR__.'/ecs.php', + __DIR__.'/rector.php', ]) ->withSkip([ MethodChainingIndentationFixer::class => [ @@ -33,5 +36,5 @@ ->withParallel() ->withSpacing(Option::INDENTATION_SPACES, "\n") ->withConfiguredRule(HeaderCommentFixer::class, ['header' => "This file is part of Contao.\n\n(c) Leo Feyer\n\n@license LGPL-3.0-or-later"]) - ->withCache(sys_get_temp_dir().'/ecs_monorepo_cache') + ->withCache(sys_get_temp_dir().'/monorepo_ecs_cache') ; diff --git a/rector.php b/rector.php index 411ba24..760f22b 100644 --- a/rector.php +++ b/rector.php @@ -2,20 +2,31 @@ declare(strict_types=1); +/* + * This file is part of Contao. + * + * (c) Leo Feyer + * + * @license LGPL-3.0-or-later + */ + +use Contao\Rector\Set\SetList; use Rector\Config\RectorConfig; use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector; return RectorConfig::configure() - ->withSets([__DIR__.'/vendor/contao/code-quality/config/rector.php']) + ->withSets([SetList::CONTAO]) ->withPaths([ __DIR__.'/src', __DIR__.'/tests', + __DIR__.'/ecs.php', + __DIR__.'/rector.php', ]) ->withSkip([ JsonThrowOnErrorRector::class, NullToStrictStringFuncCallArgRector::class, ]) ->withParallel() - ->withCache(sys_get_temp_dir().'/rector_monorepo_cache') + ->withCache(sys_get_temp_dir().'/monorepo_rector_cache') ;