1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Add section on using a baseline

This commit is contained in:
Matthew Brown 2019-01-03 08:58:54 -05:00 committed by GitHub
parent 6480b69db4
commit b081256f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,3 +74,19 @@ function (int $a) : string {
return $a;
}
```
## Using a baseline file
If you have a bunch of errors and you don't want to fix them all at once, Psalm can now grandfather-in errors in existing code, while ensuring that new code doesn't have those same sorts of errors.
```
vendor/bin/psalm --set-baseline=your-baseline.xml
```
will generate a file containing the current errors. You can commit that generated file so that Psalm running in other places (e.g. CI) won't complain about those errors either, and you can update that baseline file (to remove references to things that have been fixed) with
```
vendor/bin/psalm --update-baseline
```
Your mileage may vary, but we've found baseline files to be a great way to gradually improve a codebase.