rector/CONTRIBUTING.md
Tomas Votruba 3001d27efb Updated Rector to commit f422877be87a75151eb6fe1cd5a48cde2bc194fa
f422877be8 Add git to Dockerfile to allow running tests (#5987)
2024-06-20 11:56:25 +00:00

1.8 KiB

How to Contribute

Contributions here are more than welcomed! You can contribute to rector-src repository or one of extension packages.

Preparing Local Environment

  1. Fork the rector/rector-src repository and clone it
git clone git@github.com:<your-name>/rector-src.git
cd rector-src
  1. We use PHP 8.2 and composer

Install dependencies and verify your local environment:

composer update
composer check-platform-reqs

Note: using Docker for contributing is strongly discouraged, as it requires extra knowledge of composer internals.

Then you can start working with the code 👍


Do you want to contribute a failing test? This tutorial will show you how

Preparing Pull Request

3 steps will make your pull-request easy to merge:

  • 1 feature per pull-request

  • new features need tests

  • CI must pass... you can mimic it locally by running

    composer complete-check
    
  • Do you need to fix coding standards?

    composer fix-cs
    

We would be happy to accept PRs that follow these guidelines.

Using Docker

A docker-compose.yml file is provided to make it easier to run the CI checks locally. To use it, you need to have Docker installed on your machine, then you can build the image and execute the above commands in a docker container:

# Build the docker image
docker compose build

# Run the entire CI suite
compose compose run php complete-check

# Fix the coding standards
docker compose run php fix-cs

Repository layout

Documentation goes into build/target-repository/docs.