-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Allow packages without repository #36
Merged
Merged
Changes from 14 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4763b1b
allow packages without repository
zarianec ecbdf01
count invalid packages
zarianec 97771da
update tests
zarianec 7cc3e99
Merge remote-tracking branch 'origin/master' into null-repos
zarianec 68088f0
cache packages without repository
zarianec f1c1cc7
Merge remote-tracking branch 'origin/master' into null-repos
zarianec ac5fdb7
add tests
zarianec 92ae588
Merge remote-tracking branch 'origin/master' into null-repos
zarianec 843eb97
fix bug with deleting of packages
zarianec 6911aa5
revert tests and apply changes from #39
zarianec 85df95b
Merge remote-tracking branch 'origin/master' into null-repos
zarianec 603689e
use Map to store the packages
zarianec a1e9637
update sorting
zarianec 608c580
fix extra delete keyword
zarianec 5512572
fix hostnames filter
zarianec 5283201
Merge remote-tracking branch 'origin/master' into null-repos
zarianec f946128
updated metadata
zarianec 5847d6e
Merge remote-tracking branch 'origin/master' into null-repos
zarianec 801d7b5
Merge remote-tracking branch 'origin/master' into null-repos
zarianec f772b92
update metadata
zarianec 068f97f
ignore .idea
zarianec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -13,16 +13,26 @@ module.exports = { | ||||||||||||||||||||||||||||||||||
const total = metadata.packages | |||||||||||||||||||||||||||||||||||
const repos = metadata.repos | |||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||
const areNull = repos.unsets || 0 | |||||||||||||||||||||||||||||||||||
const notNull = total - areNull | |||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||
const perc = (val) => (val * 100 / total).toFixed(2) | |||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||
return dedent` | |||||||||||||||||||||||||||||||||||
<!-- stats --> | |||||||||||||||||||||||||||||||||||
Packages | Count | Percentage | |||||||||||||||||||||||||||||||||||
-------- | ----- | ---------- | |||||||||||||||||||||||||||||||||||
With repository in package.json | ${total} | 100% | |||||||||||||||||||||||||||||||||||
:------- | -----:| ----------: | |||||||||||||||||||||||||||||||||||
With repository | ${notNull} | ${perc(notNull)}% | |||||||||||||||||||||||||||||||||||
Null repository | ${areNull} | ${perc(areNull)}% | |||||||||||||||||||||||||||||||||||
**Total** | ${total} | ${perc(total)}% | |||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: unnecessary whitespace here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's required here to split two tables. See how it looks without it:
|
|||||||||||||||||||||||||||||||||||
Providers | Count | Percentage | |||||||||||||||||||||||||||||||||||
:-------- | -----:| ----------: | |||||||||||||||||||||||||||||||||||
GitHub | ${repos.github} | ${perc(repos.github)}% | |||||||||||||||||||||||||||||||||||
GitLab | ${repos.gitlab} | ${perc(repos.gitlab)}% | |||||||||||||||||||||||||||||||||||
Bitbucket | ${repos.bitbucket} | ${perc(repos.bitbucket)}% | |||||||||||||||||||||||||||||||||||
Others | ${repos.others} | ${perc(repos.others)}% | |||||||||||||||||||||||||||||||||||
**Total** | ${notNull} | ${perc(notNull)}% | |||||||||||||||||||||||||||||||||||
<!-- /stats --> | |||||||||||||||||||||||||||||||||||
` | |||||||||||||||||||||||||||||||||||
} | |||||||||||||||||||||||||||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use
.filter(Boolean)
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fixed.