Commit e39000b5 authored by Pierre Dittgen's avatar Pierre Dittgen

Fix Custom checks urls and syntax

parent 92d9014f
......@@ -9,7 +9,7 @@ from validata_ui_next.validate import ValidatorHelper
schemas_config = {
"scdl-adresses": {
"schema_json_url": "https://git.opendatafrance.net/scdl/adresses/raw/master/schema-scdl-adresses.json",
"custom_checks_json_url": "https://git.opendatafrance.net/scdl/adresses/raw/master/custom-checks.json",
"custom_checks_json_url": "https://git.opendatafrance.net/scdl/adresses/raw/master/goodtables-checks.json",
"title": "Adresses locales",
"description": "Liste des adresses locales d'une collectivité",
"specurl": "http://www.opendatafrance.net/SCDL_Adresses_Locales",
......@@ -28,7 +28,7 @@ schemas_config = {
},
"scdl-deliberations": {
"schema_json_url": "https://git.opendatafrance.net/scdl/deliberations/raw/master/schema.json",
"custom_checks_json_url": "https://git.opendatafrance.net/scdl/deliberations/raw/master/custom-checks.json",
"custom_checks_json_url": "https://git.opendatafrance.net/scdl/deliberations/raw/master/goodtables-checks.json",
"title": "Délibérations",
"description": "Liste des délibérations adoptées par une assemblée locale",
"specurl": "http://www.opendatafrance.net/SCDL_Deliberations",
......@@ -46,8 +46,8 @@ schemas_config = {
},
"scdl-marches-publics": {
"schema_json_url": "https://git.opendatafrance.net/scdl/marches-publics/raw/pdi/schema.json",
"custom_checks_json_url": "https://git.opendatafrance.net/scdl/marches-publics/raw/pdi/custom-checks.json",
"schema_json_url": "https://git.opendatafrance.net/scdl/marches-publics/raw/v1.2/schema.json",
"custom_checks_json_url": "https://git.opendatafrance.net/scdl/marches-publics/raw/v1.2/goodtables-checks.json",
"title": "Marchés publics",
"description": "Liste des marchés publics attribués par une collectivité",
"specurl": "http://www.opendatafrance.net/SCDL_Marches_Publics",
......@@ -64,8 +64,8 @@ schemas_config = {
]
},
"scdl-prenoms": {
"schema_json_url": "https://github.com/CharlesNepote/liste-prenoms-nouveaux-nes/raw/v1.1.1/prenom-schema.json",
# "custom_checks_json_url": "https://git.opendatafrance.net/scdl/prenoms/raw/master/custom-checks.json",
"schema_json_url": "https://github.com/Jailbreak-Paris/liste-prenoms-nouveaux-nes/raw/v1.1.3/prenom-schema.json",
"custom_checks_json_url": "https://github.com/Jailbreak-Paris/liste-prenoms-nouveaux-nes/raw/v1.1.3/goodtables-checks.json",
"title": "Prénoms des nouveaux-nés",
"description": "Liste des prénoms des nouveaux-nés déclarés à l'état-civil",
"specurl": "https://docs.google.com/document/d/1Vk0kpBw3MIocai9JqovLK2HxcUA_3QHnZicqxuOpcQ8/edit?usp=sharing",
......@@ -83,7 +83,7 @@ schemas_config = {
},
"scdl-subventions": {
"schema_json_url": "https://git.opendatafrance.net/scdl/subventions/raw/master/schema.json",
"custom_checks_json_url": "https://git.opendatafrance.net/scdl/subventions/raw/master/custom-checks.json",
"custom_checks_json_url": "https://git.opendatafrance.net/scdl/subventions/raw/master/goodtables-checks.json",
"title": "Subventions",
"description": "Liste des subventions publiques attribuées par une collectivité",
"specurl": "http://www.opendatafrance.net/SCDL_Subventions",
......
......@@ -93,15 +93,13 @@ class ValidatorHelper:
# Build checks configuration
checks = ['structure', 'schema']
pre_checks_conf = []
pre_checks_conf = None
if 'custom_checks' in sc_info:
c_checks = sc_info['custom_checks']
for check_conf in c_checks['checks']:
checks.append({check_conf['name']: check_conf['params']})
if 'pre_checks' in c_checks:
for check_conf in c_checks['pre_checks']:
pre_checks_conf.append({check_conf['name']: check_conf['params']})
if 'custom_checks' in c_checks:
for check_conf in c_checks['custom_checks']:
checks.append({check_conf['name']: check_conf['params']})
pre_checks_conf = c_checks.get('pre_checks')
inspector = Inspector(checks=checks, row_limit=VALIDATA_MAX_ROWS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment