Skip to content

Option to group errors by error type - proposal #1686

@LeonardoCA

Description

@LeonardoCA

When starting to use PHPStan on an existing project there might be thousands of errors.

In this case I find useful to group the errors by error type to be able to handle similar errors together and to have an overview which errors need attention first.

The challenge is there is no errorType property in AnalysisResult

I wrote a custom formatter, which uses regular expressions on the error messages as a workaround, but it is nasty and not reliable solution

The desired output

List of errors grouped by error type
swk_phpstan_expanded

A compact summary of error types and counts as an overview
swk_phpstan_l2

I did get this compact report by commenting out one line in my custom formatter. This would need to be a second formater or there needs to be a possibility to pass a parameter to the formater from the command line.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions