Commit 82af11c6 authored by Pierre Dittgen's avatar Pierre Dittgen

Refactor code

parent 3f200a10
......@@ -325,18 +325,16 @@ def validate(source, schema, with_repair=True, **options):
"custom_loaders": loaders.custom_loaders, # to use Validata BytesLoader
fixed_source, structure_errors = source, None
checks = ['structure', 'schema', {'extra-or-missing-header': {}}]
if with_repair:
fixed_source, structure_errors = repair(source, schema_descriptor, **base_options)
structure_errors = None
fixed_source = source
checks = ['structure', 'schema']
checks = ['structure', 'schema', {'extra-or-missing-header': {}}]
custom_checks_config = schema_descriptor.get('custom_checks')
if custom_checks_config:
for custom_check_conf in custom_checks_config:
checks.append({custom_check_conf['name']: custom_check_conf['params']})
inspector = goodtables.Inspector(
skip_checks=['non-matching-header', 'extra-header', 'missing-header'],
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