-
Notifications
You must be signed in to change notification settings - Fork 545
Add Grouped Error Formatter #4002
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
Conversation
How is this helpful, should't the grouping be done on filename basis?
The reason is many different errors are related, thus errors for LoC close to each other should be reported together.
We introduced PHPStan to our codebase a few weeks ago. We started with level 0 and added all existing errors to the baseline file.
Then our workflow is as follows:
- Delete all ignored errors from the baseline
- Use this grouped error formatter for error analysis
- Assign one developer to each error type
- Fix the errors one at a time
- Increase the level by 1
- Repeat
Shouldn't the grouping be done by filename?
We have found it much easier to do research on one specific error type at a time. Often, you can find an answer right away on how to fix the underlying bugs, and then apply it to all similar ones.
# Conflicts: # conf/config.neon
Description
This PR introduces a new error formatter that groups all errors by their identifier. Groups are sorted in descending order based on the number of occurrences. The output format is a hybrid of the raw and table error formatters.
All error lines are clickable for easy code navigation. As with the table error formatter, the
file:lineformat can be customized via theeditorUrlandeditorUrlTitleparameters.Usage
Use Case
This formatter is particularly useful when working with a large number of errors, for example, when introducing PHPStan to an existing codebase. Grouping by error identifier instead of by file helps speed up the review and fixing process.
Example Output
Screenshot
grafik