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

feat(cli): add diagnostic summary #2742

Merged
merged 4 commits into from May 20, 2024
Merged

feat(cli): add diagnostic summary #2742

merged 4 commits into from May 20, 2024

Conversation

ematipico
Copy link
Member

@ematipico ematipico commented May 6, 2024

Summary

Closes #57

This PR creates a new reporter called summary. This reporter reads the diagnostics emitted by the traversal and compiles information that is eventually printed to the terminal.

The most exhaustive case is when we run check/ci, because that's when we call all the tools, hence, I tried to come up with a summary that makes sense for each tool.

Thanks to the feedback received, I landed this: #57 (comment)

The comment contains an explanation of why the information is broken down the way it is.

The linter block is sorted by the length of the diagnostic name, which is why the type RuleName implements the ordering traits. I wanted to find the longest name so I could correctly calculate the padding in a predictable way, and print something nice to see.

Test Plan

Added cases for check, ci, format and lint

@github-actions github-actions bot added the A-CLI Area: CLI label May 6, 2024
@ematipico ematipico marked this pull request as ready for review May 16, 2024 16:50
@ematipico ematipico requested review from a team May 16, 2024 16:50
@github-actions github-actions bot added the A-Changelog Area: changelog label May 16, 2024
@ematipico
Copy link
Member Author

I am going to merge this. Feel free to leave some comments in case there's something wrong and requires some attention

@ematipico ematipico merged commit cead069 into main May 20, 2024
13 checks passed
@ematipico ematipico deleted the feat/cli-summary branch May 20, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-CLI Area: CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Implement biome lint --summary
1 participant