Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support filtering of baselines #141

Open
staabm opened this issue Oct 2, 2023 · 1 comment
Open

Support filtering of baselines #141

staabm opened this issue Oct 2, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@staabm
Copy link
Owner

staabm commented Oct 2, 2023

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

@staabm staabm added the enhancement New feature or request label Oct 2, 2023
@staabm
Copy link
Owner Author

staabm commented Oct 12, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant