Skip to content

Commit 3a9107f

Browse files
authored
README: merge usage & migration from single baseline (#28)
1 parent cb4a3e4 commit 3a9107f

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

README.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,24 @@ composer require --dev shipmonk/phpstan-baseline-per-identifier
3535
> [!IMPORTANT]
3636
> _This usage is available since version 2.0. See legacy usage below if you are still using PHPStan 1.x_
3737
38-
Setup baselines loader, other files will be placed beside that file:
39-
```neon
40-
# phpstan.neon.dist
41-
includes:
42-
- baselines/loader.neon # instead of traditional phpstan-baseline.neon
38+
Remove old single baseline include:
39+
```diff
40+
-includes:
41+
- - phpstan-baseline.neon
4342
```
4443

45-
Run native baseline generation and split it into multiple files via our script:
44+
Run native baseline generation and split it into multiple files via our script (other baseline files will be placed beside the loader):
4645
```sh
4746
vendor/bin/phpstan --generate-baseline=baselines/loader.neon && vendor/bin/split-phpstan-baseline baselines/loader.neon
4847
```
4948

49+
Setup the baselines loader:
50+
```neon
51+
# phpstan.neon.dist
52+
includes:
53+
- baselines/loader.neon
54+
```
55+
5056
_(optional)_ You can simplify generation with e.g. composer script:
5157
```json
5258
{
@@ -99,10 +105,3 @@ Prepare composer script to simplify generation:
99105
## PHP Baseline
100106
- If the loader file extension is php, the generated files will be php files as well
101107

102-
## Migrating from single baseline
103-
104-
1. `rm phpstan-baseline.neon` (and remove its include from `phpstan.neon.dist`)
105-
2. `mkdir baselines`
106-
3. `touch baselines/loader.neon` (and include it in `phpstan.neon.dist`)
107-
4. Run the split script from above
108-

0 commit comments

Comments
 (0)