diff --git a/docs/running_psalm/dealing_with_code_issues.md b/docs/running_psalm/dealing_with_code_issues.md index 37ac5322d1e..3563820c319 100644 --- a/docs/running_psalm/dealing_with_code_issues.md +++ b/docs/running_psalm/dealing_with_code_issues.md @@ -99,12 +99,40 @@ If you have a bunch of errors and you don't want to fix them all at once, Psalm 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 +will generate a file containing the current errors. You should commit that generated file so that Psalm can use it when running in other places (e.g. CI). It won't complain about those errors either. + +You have two options to use the generated baseline when running psalm: + +``` +vendor/bin/psalm --use-baseline=your-baseline.xml +``` + +or using the configuration: + +```xml + + + ... + +``` + +To update that baseline file, use ``` vendor/bin/psalm --update-baseline ``` +This will remove fixed issues, but will _not_ add new issues. To add new issues, use `--set-baseline=...`. + +In case you want to run psalm without the baseline, run + +``` +vendor/bin/psalm --ignore-baseline +``` + Baseline files are a great way to gradually improve a codebase. ## Using a plugin