mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
78365452d3
* Moved universe-test into .github folder * Cleaned code * CHanged a file name
20 lines
506 B
Python
20 lines
506 B
Python
import json
|
|
import re
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def validate_json(document):
|
|
universe_file = Path(document)
|
|
with universe_file.open() as f:
|
|
universe_data = json.load(f)
|
|
for entry in universe_data["resources"]:
|
|
if "github" in entry:
|
|
assert not re.match(
|
|
r"^(http:)|^(https:)", entry["github"]
|
|
), "Github field should be user/repo, not a url"
|
|
|
|
|
|
if __name__ == "__main__":
|
|
validate_json(str(sys.argv[1]))
|