-
-
Notifications
You must be signed in to change notification settings - Fork 928
Description
Feature request
Since PHPStan 0.12.18, there is a dedicated CLI option for regenerating the baseline file --generate-baseline
.
When using it, it would do 2 things from user perspective:
- Any new errors that are reported would be ignored
- Any existing ignore rules which are no longer matching would be cleaned up
I'm suggesting another option which would only do the second. This option would just remove rules from the baseline that are not matching, but continue to report new errors.
This is useful in a very key scenario - you have a codebase where there are a lot of ignored errors, but you want to enforce stricter rules for any new code. When you use the baseline for that, you end up with a lot of ignored errors in the baseline. With refactoring, a lot of those would be reported as unmatched rules which is great and you'd clean those up. But if at the same time there are new errors, you would assimilate them in the baseline and ignore them instead of fixing them.
With this option a more automated process could be introduced where no longer matching rules are automatically or semi-automatically cleaned up from the baseline. It will also ensure a more stable usage of regenerating the baseline where people would more explicitly ignore actual errors.