Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Validata
Validata Core
Commits
6f6dc913
Commit
6f6dc913
authored
Oct 29, 2021
by
Pierre Dittgen
Browse files
Simplify code
parent
42a5b41a
Changes
1
Hide whitespace changes
Inline
Side-by-side
validata_core/__init__.py
View file @
6f6dc913
...
@@ -108,15 +108,12 @@ def validate(source, schema, **options):
...
@@ -108,15 +108,12 @@ def validate(source, schema, **options):
]
]
# Dynamically add custom check based on schema needs
# Dynamically add custom check based on schema needs
custom_checks_config
=
schema
.
get
(
"custom_checks"
)
for
cc_conf
in
schema
.
get
(
"custom_checks"
,
[]):
if
custom_checks_config
:
cc_name
=
cc_conf
[
"name"
]
# extra_checks = []
if
cc_name
in
available_checks
:
for
cc_conf
in
custom_checks_config
:
cc_class
=
available_checks
[
cc_name
]
cc_name
=
cc_conf
[
"name"
]
cc_descriptor
=
cc_conf
[
"params"
]
if
cc_name
in
available_checks
:
extra_checks
.
append
(
cc_class
(
cc_descriptor
))
cc_class
=
available_checks
[
cc_name
]
cc_descriptor
=
cc_conf
[
"params"
]
extra_checks
.
append
(
cc_class
(
cc_descriptor
))
# Merge options to pass to frictionless
# Merge options to pass to frictionless
validate_options
=
{
validate_options
=
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment