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

How to create multiple badges for README.md #43

Closed
oguzsh opened this issue Jun 17, 2021 · 6 comments
Closed

How to create multiple badges for README.md #43

oguzsh opened this issue Jun 17, 2021 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@oguzsh
Copy link

oguzsh commented Jun 17, 2021

Hey!

I wanna create multiple coverage reports then I need two different markdown templates in README.md. How can I do that?

Example:

X Coverage Report Badges 

| Statements                                                               | Functions                                                                    | Lines                                                              | Code Quality                                                                                                                                                                                                                                  |
| ------------------------------------------------------------------------ | ---------------------------------------------------------------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![Statements](https://img.shields.io/badge/Coverage-88.72%25-yellow.svg) | ![Functions](https://img.shields.io/badge/Coverage-91.94%25-brightgreen.svg) | ![Lines](https://img.shields.io/badge/Coverage-89.2%25-yellow.svg) | [![Codacy Badge](https://app.codacy.com/project/badge/Grade/46159b0d28324e2485f32409d1b82960)](https://www.codacy.com?utm_source=gitlab.com&utm_medium=referral&utm_content=remoteteam/marketplace-core&utm_campaign=Badge_Grade) |

Y Coverage Report Badges

| Statements                                                               | Functions                                                                    | Lines                                                              | Code Quality                                                                                                                                                                                                                                  |
| ------------------------------------------------------------------------ | ---------------------------------------------------------------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![Statements](https://img.shields.io/badge/Coverage-88.72%25-yellow.svg) | ![Functions](https://img.shields.io/badge/Coverage-91.94%25-brightgreen.svg) | ![Lines](https://img.shields.io/badge/Coverage-89.2%25-yellow.svg) | [![Codacy Badge](https://app.codacy.com/project/badge/Grade/46159b0d28324e2485f32409d1b82960)](https://www.codacy.com?utm_source=gitlab.com&utm_medium=referral&utm_content=remoteteam/marketplace-core&utm_campaign=Badge_Grade) |
@olavoparno
Copy link
Member

Hi there @oguzsh thanks for the issue. By any chance, are those coverages from different projects, this, different coverage Istanbul reports? Currently it is not available to fulfill the README from different reports.

@venturalp so you see a way to achieve such thing?

@oguzsh please correct me if I got it wrong.

@oguzsh
Copy link
Author

oguzsh commented Jun 17, 2021

Same project but different coverage reports.

I got coverage1.json and coverage2.json files and I need to separate these reports in README.md file

@olavoparno
Copy link
Member

Hmm as I feared. It's not possible as it is. Would you be so kind by thinking of a way and opening a PR having backwards compatibility in mind? We'll try to figure it out too.

@oguzsh
Copy link
Author

oguzsh commented Jun 17, 2021

Maybe I can combine these reports then I will have just one coverage report. But I am gonna think about how can i use different reports in just one README.md then create a PR.

Thanks for your answers!

@olavoparno
Copy link
Member

@oguzsh did you manage to think of a way into achieving this behavior? I think we could be closing this issue.

@oguzsh
Copy link
Author

oguzsh commented Jul 6, 2021

Maybe, project can give multiple arguments in the command line then you can handle according to how many input file exists on args. When you take these inputs and add them to the array, you can create a template for every file coverage report. In this way, you can push these templates on a README.md file with one per newline space.

Example :
npm run istanbul-badges-readme -inputs file1.json file2.json --out covarage.final.json

This is just an idea I didn't code this feature at the moment coz I am so busy for now. But if you wanna handle this, you can 💯

@olavoparno olavoparno added the help wanted Extra attention is needed label Aug 7, 2021
@oguzsh oguzsh closed this as completed Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants