10BC0 Filter errors based on error identifier · Issue #14006 · phpstan/phpstan · GitHub
[go: up one dir, main page]

Skip to content

Filter errors based on error identifier #14006

@sebastianbergmann

Description

@sebastianbergmann

Feature request

When it comes to raising the error level of an existing code base, I prefer to tackle one error type at a time. Although I appreciate UNIX's KISS principle and pipes and filters, I wish I did not have to do this:

./tools/phpstan --level=10 --error-format=json | jq -r '.files | to_entries[] | . as $file | .value.messages[] | select(.identifier == "<errorIdentifier>") | "\($file.key):\(.line) \(.message)"'

In the above, <errorIdentifier> is a placeholder for the identifier for the specific error type I am interested in, for example return.type.

It would be nice if PHPStan had a --filter <errorIdentifier> CLI option that would only display errors of the specified type.

Did PHPStan help you today? Did it make you happy in any way?

Yes, PHPStan helps me every day.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0