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

"No errors found!" message is now printed within a nice green block #7150

Merged
merged 1 commit into from Dec 14, 2021

Conversation

SMAtaurRahman
Copy link
Contributor

Last week, I introduced psalm+phpstan to some juniors and I noticed they liked visual feedback of phpstan better than psalm.
I have tried to find why is so.

When errors are found, psalm kinda punishes our eyes with all the red texts of error message, but when we fixed them all, it just prints some dull looking texts. I had to guide the juniors multiple time to just ignore all the texts and look for "No errors found!" among them.
Only way to know psalm run status at a glance is to check if terminal has red color text or not.

I think, psalm should have a success page with green (or similar) color which kinda works as a reward for fixing all the errors. We all love the dopamine hit.

So, I've prepared this PR that will print a nice green block when there are no errors to report.

printSuccessMessage could be made as more flexible, such as accepting arbitrary message and dynamically calculate padding size. But I think that would increase the complexity unnecessarily since we are printing a hard-coded string anyway.

Let me know what do you think. Thanks.

@weirdan weirdan added the release:feature The PR will be included in 'Features' section of the release notes label Dec 13, 2021
@weirdan
Copy link
Collaborator

weirdan commented Dec 13, 2021

It's a bit hard to read with the terminal color scheme I'm using (Solarized Dark):

image

@SMAtaurRahman
Copy link
Contributor Author

It's a bit hard to read with the terminal color scheme I'm using (Solarized Dark):

image

Yep, I was not so sure about this part as well. Maybe we can use white/black as text color?

@weirdan
Copy link
Collaborator

weirdan commented Dec 14, 2021

Looking great now:
image

@weirdan weirdan merged commit 832fc35 into vimeo:master Dec 14, 2021
@weirdan
Copy link
Collaborator

weirdan commented Dec 14, 2021

Thanks!

@SMAtaurRahman SMAtaurRahman deleted the pretty-success-message branch December 14, 2021 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature The PR will be included in 'Features' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants