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

Fixed [Codacy] coverage examples and improved unknown coverage handling #2102

Merged
merged 4 commits into from
Sep 21, 2018

Conversation

PyvesB
Copy link
Member

@PyvesB PyvesB commented Sep 19, 2018

The project used on the homepage doesn't have any relevant coverage data:

I've switched it to one that does:

As you can see above the unknown coverage case is handled pretty poorly, with the exclamation mark and the bright green colour. From now on, such a badge would render as:

@PyvesB PyvesB added bug Bugs in badges and the frontend service-badge New or updated service badge labels Sep 19, 2018
@shields-ci
Copy link

Messages
📖

✨ Thanks for your contribution to Shields, @PyvesB!

📖

Thanks for contributing to our documentation. We ❤️ our documentarians!

Generated by 🚫 dangerJS

@PyvesB PyvesB mentioned this pull request Sep 19, 2018
Copy link
Member

@chris48s chris48s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cheers for having a look at this

badgeData.text[1] = res
badgeData.colorscheme = coveragePercentageColor(parseInt(res))
const coverage = parseInt(res)
if (isNaN(coverage)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a case where it is better to use Number.isNaN() in preference to isNaN()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! 👍

@PyvesB PyvesB merged commit a4bec27 into badges:master Sep 21, 2018
@shields-deployment
Copy link

This pull request was merged to master branch. This change is now waiting for deployment, which will usually happen within a few days. Stay tuned by joining our #ops channel on Discord!

After deployment, changes are copied to gh-pages branch:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend service-badge New or updated service badge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants