phpstan-baseline-analysis
phpstan-baseline-analysis copied to clipboard
Support filtering of baselines
trafficstars
atm the tool is able to analyze existing baselines and provide a summary as a result, grouped into categories:
Overall-Errors: 41
Classes-Cognitive-Complexity: 70
Deprecations: 2
Invalid-Phpdocs: 5
Unknown-Types: 1
Anonymous-Variables: 4
Native-Property-Type-Coverage: 1
Native-Param-Type-Coverage: 27
Native-Return-Type-Coverage: 4
Unused-Symbols: 3
it would be great if I could filter existing baselines, based on category, and get back a new baseline. this would allow me to work with focus on a certain problem area, without manually searching the existing full-project-baseline
example 1 (which outputs all filtered content on stdout)
phpstan-baseline-analyze '*phpstan-baseline.neon' --filter=Deprecations
example 2(which outputs the content into new-baseline.neon)
phpstan-baseline-analyze '*phpstan-baseline.neon' --filter=Invalid-Phpdocs > new-baseline.neon
the result should be rendered in neon-format, like the default PHPStan baseline, so we can further process it with whatever tool which supports the default phpstan baseline format
Additional ideas
- regenerate/filter existing baselines so all errors machting the filters will be deleted from the baseline. That way a regular phpstan analysis will match these errors
- filter by phpstan native error identifiers