Open
Conversation
theofidry
reviewed
Dec 3, 2023
| 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 |
Contributor
There was a problem hiding this comment.
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-fixerThis 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-binintotools: https://github.com/bamarni/composer-bin-plugin#target-directory-target-directory - I recommend you to lock the dependencies, i.e. publish the
composer.lockfor rector and PHP-CS-Fixer. - You probably don't want to do a
composer requirein 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 |
Contributor
There was a problem hiding this comment.
why is it running with Xdebgu?
|
|
||
| $finder = PhpCsFixer\Finder::create()->in([__DIR__]); | ||
|
|
||
| return (new PhpCsFixer\Config()) |
Contributor
There was a problem hiding this comment.
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) |
Contributor
There was a problem hiding this comment.
no cache? Personally I like to use it but I put the output in a dist/ directory
Co-authored-by: Théo FIDRY <5175937+theofidry@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.