drop ecs-after-rector, recommend current setup (#4944)

This commit is contained in:
Tomas Votruba 2020-12-22 17:14:24 +01:00 committed by GitHub
parent cfcb237612
commit a3db386854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 33 deletions

View File

@ -9,8 +9,7 @@ phpstan.neon
rector.php
phpunit.xml
ecs.php
ecs-after-rector.php
changelog-linker.yaml
changelog-linker.php
LICENSE

View File

@ -259,4 +259,4 @@ Do you use Rector to upgrade your code? Add it here:
Rector uses [nikic/php-parser](https://github.com/nikic/PHP-Parser/), built on technology called an *abstract syntax tree* (AST). An AST doesn't know about spaces and when written to a file it produces poorly formatted code in both PHP and docblock annotations. **That's why your project needs to have a coding standard tool** and a set of formatting rules, so it can make Rector's output code nice and shiny again.
Don't have a coding standard tool? Add [ECS](https://github.com/Symplify/EasyCodingStandard) and use prepared [`ecs-after-rector.php`](/ecs-after-rector.php) set.
We're using [ECS](https://github.com/symplify/easy-coding-standard) with [this setup](ecs.php).

View File

@ -1,30 +0,0 @@
<?php declare(strict_types=1);
use Rector\Core\Configuration\Option;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
use PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer;
use PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(NoUnusedImportsFixer::class);
$services->set(OrderedImportsFixer::class);
$services->set(NoLeadingImportSlashFixer::class);
$services->set(NoTrailingWhitespaceInCommentFixer::class);
$services->set(NoEmptyPhpdocFixer::class);
$services->set(ClassAttributesSeparationFixer::class);
$services->set(DeclareStrictTypesFixer::class);
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SETS, [
SetList::DOCTRINE_ANNOTATIONS,
]);
};