Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afa8c1b105 |
5 changed files with 373 additions and 9808 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
|
@ -1 +0,0 @@
|
||||||
/packages.json merge=union
|
|
||||||
14
.travis.yml
14
.travis.yml
|
|
@ -4,20 +4,18 @@ dist: trusty
|
||||||
|
|
||||||
language: c
|
language: c
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- "$HOME/.choosenim"
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- export CHOOSENIM_CHOOSE_VERSION="0.18.0"
|
|
||||||
- |
|
- |
|
||||||
curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
|
wget http://nim-lang.org/download/nim-0.13.0.tar.xz
|
||||||
sh init.sh -y
|
tar xf nim-0.13.0.tar.xz
|
||||||
- export PATH=$HOME/.nimble/bin:$PATH
|
cd nim-0.13.0
|
||||||
|
sh build.sh
|
||||||
|
cd ..
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- set -e
|
- set -e
|
||||||
- set -x
|
- set -x
|
||||||
|
- export PATH=`pwd`/nim-0.13.0/bin:$PATH
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- nim c -d:ssl -r package_scanner.nim && node ./validate_json.js
|
- nim c -d:ssl -r package_scanner.nim && node ./validate_json.js
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ This is a central listing of all packages for
|
||||||
[Nimble](https://github.com/nim-lang/nimble), a package manager for the
|
[Nimble](https://github.com/nim-lang/nimble), a package manager for the
|
||||||
[Nim programming language](http://nim-lang.org).
|
[Nim programming language](http://nim-lang.org).
|
||||||
|
|
||||||
An overview of all packages is available at https://nimble.directory.
|
An overview of all Nimble packages is available in the
|
||||||
|
[library documentation](https://nim-lang.org/docs/lib.html#nimble).
|
||||||
|
|
||||||
NOTE: The packages listed here are not peer-reviewed or otherwise screened. We try to keep the list up-to-date but we cannot guarantee quality or maturity of the packages.
|
NOTE: The packages listed here are not peer-reviewed or otherwise screened. We try to keep the list up-to-date but we cannot guarantee quality or maturity of the packages.
|
||||||
|
|
||||||
|
|
@ -36,7 +37,6 @@ While we really appreciate your contribution, please follow the requirements: ot
|
||||||
* The package should build correctly with the latest Nim release
|
* The package should build correctly with the latest Nim release
|
||||||
* The package should not contain files without a license or in breach of 3rd parties licensing
|
* The package should not contain files without a license or in breach of 3rd parties licensing
|
||||||
* Non-mature packages should be flagged as such, especially if they perform security-critical tasks (e.g. encryption)
|
* Non-mature packages should be flagged as such, especially if they perform security-critical tasks (e.g. encryption)
|
||||||
* If a vulnerability is found, make a patch release against the latest stable release (or more) that fixes the issue without introducing any other change.
|
|
||||||
* Tiny libraries should be avoided where possible
|
* Tiny libraries should be avoided where possible
|
||||||
* Avoid having many dependencies. Use "when defined(...)" to enable optional features.
|
* Avoid having many dependencies. Use "when defined(...)" to enable optional features.
|
||||||
* If abandoning a package, please tag it as "abandoned"
|
* If abandoning a package, please tag it as "abandoned"
|
||||||
|
|
@ -44,7 +44,7 @@ While we really appreciate your contribution, please follow the requirements: ot
|
||||||
* Provide a contact email address.
|
* Provide a contact email address.
|
||||||
* Optionally try to support older Nim releases (6 months to 1 year)
|
* Optionally try to support older Nim releases (6 months to 1 year)
|
||||||
* Optionally GPG-sign your releases
|
* Optionally GPG-sign your releases
|
||||||
* Optionally follow [SemVer 2](http://semver.org)
|
* Optionally follow [SemVer](http://semver.org)
|
||||||
|
|
||||||
Your packages may be removed if the url stops working. It goes without saying
|
Your packages may be removed if the url stops working. It goes without saying
|
||||||
that your pull request will not be accepted unless you fill out all of the
|
that your pull request will not be accepted unless you fill out all of the
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import sets
|
||||||
import strutils
|
import strutils
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
||||||
LICENSES = @[
|
LICENSES = @[
|
||||||
"Allegro 4 Giftware",
|
"Allegro 4 Giftware",
|
||||||
"Apache License 2.0",
|
"Apache License 2.0",
|
||||||
|
|
@ -46,6 +47,7 @@ const
|
||||||
"ISC",
|
"ISC",
|
||||||
"Unlicense"
|
"Unlicense"
|
||||||
]
|
]
|
||||||
|
|
||||||
VCS_TYPES = @["git", "hg"]
|
VCS_TYPES = @["git", "hg"]
|
||||||
|
|
||||||
proc canFetchNimbleRepository(name: string, urlJson: JsonNode): bool =
|
proc canFetchNimbleRepository(name: string, urlJson: JsonNode): bool =
|
||||||
|
|
@ -61,8 +63,9 @@ proc canFetchNimbleRepository(name: string, urlJson: JsonNode): bool =
|
||||||
try:
|
try:
|
||||||
discard getContent(url, timeout=10000)
|
discard getContent(url, timeout=10000)
|
||||||
except HttpRequestError, TimeoutError:
|
except HttpRequestError, TimeoutError:
|
||||||
echo "W: ", name, ": unable to fetch repo ", url, " ",
|
echo "E: ", name, ": unable to fetch repository ", url, " ",
|
||||||
getCurrentExceptionMsg()
|
getCurrentExceptionMsg()
|
||||||
|
result = false
|
||||||
except AssertionError:
|
except AssertionError:
|
||||||
echo "W: ", name, ": httpclient failed ", url, " ",
|
echo "W: ", name, ": httpclient failed ", url, " ",
|
||||||
getCurrentExceptionMsg()
|
getCurrentExceptionMsg()
|
||||||
|
|
@ -78,43 +81,57 @@ proc verifyAlias(pdata: JsonNode, result: var int) =
|
||||||
# TODO: Verify that 'alias' points to a known package.
|
# TODO: Verify that 'alias' points to a known package.
|
||||||
|
|
||||||
proc check(): int =
|
proc check(): int =
|
||||||
var name: string
|
var
|
||||||
|
name: string
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
let pkg_list = parseJson(readFile(getCurrentDir() / "packages.json"))
|
|
||||||
|
let
|
||||||
|
pkg_list = parseJson(readFile(getCurrentDir() / "packages.json"))
|
||||||
|
|
||||||
var names = initSet[string]()
|
var names = initSet[string]()
|
||||||
|
|
||||||
for pdata in pkg_list:
|
for pdata in pkg_list:
|
||||||
name = if pdata.hasKey("name"): pdata["name"].str else: ""
|
name = if pdata.hasKey("name"): pdata["name"].str else: nil
|
||||||
|
|
||||||
if pdata.hasKey("alias"):
|
if pdata.hasKey("alias"):
|
||||||
verifyAlias(pdata, result)
|
verifyAlias(pdata, result)
|
||||||
else:
|
else:
|
||||||
if name == "":
|
if name.isNil:
|
||||||
echo "E: missing package name"
|
echo "E: missing package name"
|
||||||
result.inc()
|
result.inc()
|
||||||
|
|
||||||
elif not pdata.hasKey("method"):
|
elif not pdata.hasKey("method"):
|
||||||
echo "E: ", name, " has no method"
|
echo "E: ", name, " has no method"
|
||||||
result.inc()
|
result.inc()
|
||||||
|
|
||||||
elif not (pdata["method"].str in VCS_TYPES):
|
elif not (pdata["method"].str in VCS_TYPES):
|
||||||
echo "E: ", name, " has an unknown method: ", pdata["method"].str
|
echo "E: ", name, " has an unknown method: ", pdata["method"].str
|
||||||
result.inc()
|
result.inc()
|
||||||
|
|
||||||
elif not pdata.hasKey("url"):
|
elif not pdata.hasKey("url"):
|
||||||
echo "E: ", name, " has no URL"
|
echo "E: ", name, " has no URL"
|
||||||
result.inc()
|
result.inc()
|
||||||
|
|
||||||
elif pdata.hasKey("web") and not canFetchNimbleRepository(name, pdata["web"]):
|
elif pdata.hasKey("web") and not canFetchNimbleRepository(name, pdata["web"]):
|
||||||
result.inc()
|
result.inc()
|
||||||
|
|
||||||
elif not pdata.hasKey("tags"):
|
elif not pdata.hasKey("tags"):
|
||||||
echo "E: ", name, " has no tags"
|
echo "E: ", name, " has no tags"
|
||||||
result.inc()
|
result.inc()
|
||||||
|
|
||||||
elif not pdata.hasKey("description"):
|
elif not pdata.hasKey("description"):
|
||||||
echo "E: ", name, " has no description"
|
echo "E: ", name, " has no description"
|
||||||
result.inc()
|
result.inc()
|
||||||
|
|
||||||
elif not pdata.hasKey("license"):
|
elif not pdata.hasKey("license"):
|
||||||
echo "E: ", name, " has no license"
|
echo "E: ", name, " has no license"
|
||||||
result.inc()
|
result.inc()
|
||||||
|
|
||||||
elif pdata["url"].str.normalize.startsWith("git://github.com/"):
|
elif pdata["url"].str.normalize.startsWith("git://github.com/"):
|
||||||
echo "E: ", name, " has an insecure git:// URL instead of https://"
|
echo "E: ", name, " has an insecure git:// URL instead of https://"
|
||||||
result.inc()
|
result.inc()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Other warnings should go here
|
# Other warnings should go here
|
||||||
if not (pdata["license"].str in LICENSES):
|
if not (pdata["license"].str in LICENSES):
|
||||||
|
|
|
||||||
10133
packages.json
10133
packages.json
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue