phpinsights
phpinsights copied to clipboard
[IDEA] Badges like Shields.io
| Q | A |
|---|---|
| Bug report? | no |
| Feature request? | yes |
How about phpinsights to provide natively nice badges like shields.io ? Something like to expose some dedicated route with that rendered images.
That would be badass.
Do you have any idea on how we could do that?
We might be able to pull it off if a user runs it in a Github action. We can at least make a formatter which formats to badges, so implementing the showing of the badges are easier.
We could also use directly shields.io to generate badge :
https://img.shields.io/badge/PHPInsights%20%7C%20Code%20-95.7%25-success.svg
https://img.shields.io/badge/PHPInsights%20%7C%20Style%20-61%25-yellow.svg
https://img.shields.io/badge/PHPInsights%20%7C%20Complexity%20-22%25-red.svg
And with that, we can add custom style :
https://img.shields.io/badge/PHPInsights%20%7C%20Architecture%20-78.1%25-success.svg?style=for-the-badge
But the main problem is to store it and keep them up to date. @olivernybroe do you think it's possible to store them as artifact in github action, and retrieve them directly by a link ?
@Jibbarth Haven't used artifacts before with github actions, but thought that it might be possible with artifacts. It depends kinda on how artifact url's are generated :)
So the artifacts have a random id and currently there is no API for artifacts. There are issues open for it and let's hope they add it in soon. A solution could be to use a image hosting API which have support for replacing an image, so the URL for the image doesn't change. We need it to not change, so the readme doesn't have to be updated with a new url.
Hi, I wanted this feature so much that I created it for me you 😄
This is the github action: https://github.com/Lukasss93/phpinsights-badger-action (It will uploads phpinsights data to your self hosting service)
This is the first library with the badges: https://github.com/Lukasss93/laravel-larex
If you think this is spam, please delete this message (I'm sorry 😓)
Not spam at all :) nice work, hope it will be usable for others here.