schema-enforcer
schema-enforcer copied to clipboard
Add argument for files or folder selection
Environment
- Python version: 3.9
- schema-enforcer version: 0.1.1
Pass extra argument which includes folder path or file list to be evaluated by --show-checks
or --show-pass
Proposed Functionality
By default, all structured files ending with.json
and .y[a]ml
extension are evaluated by schema-enforcer (including -- show-checks
as well as --show-pass
). Would be nice to have possibility to narrow down to a selection of files or folder that we want be evaluated by schema-enforcer
Use Case
Example:
(venv) vpn12-client-172-20-221-129:awx olivierif$ schema-enforcer validate --show-checks
Structured Data File Schema ID
--------------------------------------------------------------------------------
.//.gitlab-ci.yml []
.//requirements.yml []
.//run_config_builder_role.yml []
.//run_template_test.yml []
./conf/api.json []
./group_vars/access/includes.yml []
./group_vars/all/git.yml []
./group_vars/all/includes.yml []
./group_vars/all/infoblox.yml []
./group_vars/all/interface_profiles.yml ['schemas/interface_profiles']
./group_vars/all/main.yml []
./group_vars/all/mgmt.yml ['schemas/mgmt']
Would be nice to have something like this:
schema-enforcer validate --show-checks ./group_vars/all/interface_profiles.yml
Structured Data File Schema ID
--------------------------------------------------------------------------------
./group_vars/all/interface_profiles.yml ['schemas/interface_profiles']
or
schema-enforcer validate --show-checks ./group_vars/all/
Structured Data File Schema ID
--------------------------------------------------------------------------------
./group_vars/all/git.yml []
./group_vars/all/includes.yml []
./group_vars/all/infoblox.yml []
./group_vars/all/interface_profiles.yml ['schemas/interface_profiles']
./group_vars/all/main.yml []
./group_vars/all/mgmt.yml ['schemas/mgmt']
I like the idea and think this makes a ton of sense.