Add tighter criteria for package compliance #23
Closed
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.
This PR aims to make the following changes to the 'repository', 'bugs url' & 'bugs email' scorecard check.
Repository
Currently the scorecard only checks if the 'repository' field has own property, but this PR checks that the repo url exists, and that it includes the name of the node, such as https://github.com/Paul-Reed/ 'node-red-contrib-simpletime'.
The url format is common amongst github, bitbucket & gitlab, and verifies accordingly.
Bugs url
This PR checks that the repository property exists, and that the url slug contain 'issues', which is a common format amongst github, bitbucket & gitlab, such as 'https://github.com/Paul-Reed/node-red-contrib-simpletime/ issues'
Bugs email
As an alternative to 2) above, users can provide a support email address, and this PR checks that the bugs email property exists, and that it passes a basic regex to check it's format.
Scoring changes
This PR proposes that the score is not accredited unless 2 conditions are met, the first being the repository link, so that users can see the code used and assure themselves that the node is safe to use, look at what changes have/are being made, and also to contribute to it's development.
The second condition as well as the above, is that either the bugs url OR the bugs email is provided, so that the author may be contactable, and issues could be recorded.
https://docs.npmjs.com/cli/v7/configuring-npm/package-json
Although the nodes are not named here, the PR has been tested against a number of nodes where current anomalies exist, and does correct the score.
Examples include where non-standard nested properties are being used, and where the repo url is used instead of a bugs url (and issues git disabled).
It has also been tested against nodes using github, bitbucket & gitlab.