-
-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove ECS in favor of PHPCSFixer #1176
base: 2.x
Are you sure you want to change the base?
Conversation
composer require rector/rector symplify/easy-coding-standard --dev | ||
mkdir -p tools/php-cs-fixer tools/rector | ||
composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer --dev | ||
composer require rector/rector --dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this use case I would recommend using composer-bin-plugin with ramsey/install:
- name: Install PHP-CS-Fixer Composer bin dependencies
uses: ramsey/composer-install@v2
with:
working-directory: vendor-bin/php-cs-fixer
This would have three advantages:
- You can easily install the tool locally to run it locally too.
- The installation of the deps does not require any dependency resolution on Composer's end and the download will be cached.
- Since those are locked dependencies, you can use dependabot to periodically upgrade them:
- package-ecosystem: "composer"
directory: "vendor-bin/*/"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"
I would say though for rector I put a *
as a dependency to upgrade whenever possible.
Erratum as I see you committed tools/php-cs-fixer/composer.json
:
- You can configure bamarni-composer-bin-plugin to rename
vendor-bin
intotools
: https://github.com/bamarni/composer-bin-plugin#target-directory-target-directory - I recommend you to lock the dependencies, i.e. publish the
composer.lock
for rector and PHP-CS-Fixer. - You probably don't want to do a
composer require
in the case above
|
||
- name: CONDING STANDARDS (RECTOR) | ||
run: | | ||
vendor/bin/rector process --ansi --dry-run --xdebug | ||
tools/rector/vendor/bin/rector process . --ansi --dry-run --xdebug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it running with Xdebgu?
|
||
$finder = PhpCsFixer\Finder::create()->in([__DIR__]); | ||
|
||
return (new PhpCsFixer\Config()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you feel like it: https://github.com/theofidry/php-cs-fixer-config
Or alternatively create your own, it's relatively easy.
'array_syntax' => ['syntax' => 'short'], | ||
'phpdoc_scalar' => false, | ||
]) | ||
->setUsingCache(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no cache? Personally I like to use it but I put the output in a dist/
directory
Co-authored-by: Théo FIDRY <[email protected]>
No description provided.