From 3a9107fb8cbb339607e62f98d6449c05bc0e2928 Mon Sep 17 00:00:00 2001 From: Jan Nedbal Date: Mon, 23 Dec 2024 11:11:15 +0100 Subject: [PATCH] README: merge usage & migration from single baseline (#28) --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 024d590..8bd8fcc 100644 --- a/README.md +++ b/README.md @@ -35,18 +35,24 @@ composer require --dev shipmonk/phpstan-baseline-per-identifier > [!IMPORTANT] > _This usage is available since version 2.0. See legacy usage below if you are still using PHPStan 1.x_ -Setup baselines loader, other files will be placed beside that file: -```neon -# phpstan.neon.dist -includes: - - baselines/loader.neon # instead of traditional phpstan-baseline.neon +Remove old single baseline include: +```diff +-includes: +- - phpstan-baseline.neon ``` -Run native baseline generation and split it into multiple files via our script: +Run native baseline generation and split it into multiple files via our script (other baseline files will be placed beside the loader): ```sh vendor/bin/phpstan --generate-baseline=baselines/loader.neon && vendor/bin/split-phpstan-baseline baselines/loader.neon ``` +Setup the baselines loader: +```neon +# phpstan.neon.dist +includes: + - baselines/loader.neon +``` + _(optional)_ You can simplify generation with e.g. composer script: ```json { @@ -99,10 +105,3 @@ Prepare composer script to simplify generation: ## PHP Baseline - If the loader file extension is php, the generated files will be php files as well -## Migrating from single baseline - -1. `rm phpstan-baseline.neon` (and remove its include from `phpstan.neon.dist`) -2. `mkdir baselines` -3. `touch baselines/loader.neon` (and include it in `phpstan.neon.dist`) -4. Run the split script from above -