Skip to content

Add Rector as tool #627

@CodeCasterNL

Description

@CodeCasterNL

Describe the feature
Can Rector (https://github.com/rectorphp/rector, https://getrector.org/) be added to setup-php?

- name: Set up PHP with tools
  uses: shivammathur/setup-php@v2
  with:
    php-version: '8.1'
    tools: php-cs-fixer, phpstan, rector

Underlying issue
We use Rector (https://github.com/rectorphp/rector, https://getrector.org/) to analyze our code, in addition to PHP-CS-Fixer and PHPStan, and we --dry-run it in our GitHub Actions to check whether any code smells have been introduced.

Rector doesn't need the project's dependencies to be installed, it just checks our source files, so ideally we'd like to run it as early as possible in the pipeline, before Composer packages and whatnot have been installed.

Describe alternatives
Currently we run a composer install to install all of the project's dependencies, which includes Rector. Then we run Rector.

Are you willing to submit a PR?
I can try, I speak (Power)Shell.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions