Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add argument for files or folder selection #67

Open
lvrfrc87 opened this issue Jan 7, 2021 · 1 comment
Open

Add argument for files or folder selection #67

lvrfrc87 opened this issue Jan 7, 2021 · 1 comment

Comments

@lvrfrc87
Copy link

lvrfrc87 commented Jan 7, 2021

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']
@PhillSimonds
Copy link
Contributor

I like the idea and think this makes a ton of sense.

@PhillSimonds PhillSimonds added this to the v1.1.0 Release milestone Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants