-d:dontFetchRepos and config.nims (#2391)

* Check for empty tags

* - Added the `-d:dontFetchRepos` flag
- Made empty tags an error
- Created `config.nims`
- Removed empty tags from `packages.json`

* Revert "- Added the `-d:dontFetchRepos` flag"

This reverts commit 2b653ebcf0b242887e08b95492f2cc1b2bed3a19.

* - Made empty tags an error
- Removed empty tags from `packages.json`

* Revert "- Made empty tags an error"

This reverts commit 1d116ae808eb3a4b69449af52feac1fb547bf45e.

* - Added the `-d:dontFetchRepos` flag
- Created `config.nims`
This commit is contained in:
Patitotective 2022-12-01 17:24:54 -05:00 committed by GitHub
parent cefdc2112a
commit 4731763641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

1
config.nims Normal file
View File

@ -0,0 +1 @@
--define:ssl

View File

@ -12,7 +12,7 @@
# * Missing/unknown license
# * Insecure git:// url on GitHub
#
# Usage: nim r -d:ssl package_scanner.nim
# Usage: nim r [-d:dontFetchRepos] package_scanner.nim
#
# Copyright 2015 Federico Ceratto <federico.ceratto@gmail.com>
# Released under GPLv3 License, see /usr/share/common-licenses/GPL-3
@ -165,8 +165,10 @@ proc check(): int =
elif pkg["license"].str.toLowerAscii notin licenses:
echo "E: ", name, " has an unexpected license: ", pkg["license"]
inc result
elif pkg.hasKey("web") and not canFetchNimbleRepository(name, pkg["web"]):
echo "W: Failed to fetch source code repo for ", name
elif pkg.hasKey("web"):
when not defined(dontFetchRepos):
if not canFetchNimbleRepository(name, pkg["web"]):
echo "W: Failed to fetch source code repo for ", name
elif pkg.hasKey("tags"):
var emptyTags = 0
for tag in pkg["tags"]: