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

Option to disable recursive file search #181

Open
reconman opened this issue Nov 7, 2021 · 2 comments
Open

Option to disable recursive file search #181

reconman opened this issue Nov 7, 2021 · 2 comments

Comments

@reconman
Copy link

reconman commented Nov 7, 2021

I wanted to use Yamale to validate all YAML files in my Github repository.

But Yamale also wants to validate my .github/workflows/CI.yml file.

Can you introduce a command line option to disable recursive file searches so sub-folders are ignored?

@mildebrandt
Copy link

Thanks for the suggestion, I'll think about how this can be done. In the meantime, you can do something like the following:

find *.yaml -exec yamale -s schema.yaml {} \;

@reconman
Copy link
Author

Instead of \; at the end, it should be +, otherwise the exit code will be 0 (success) instead of 1.

This is useful for calling it as part of build pipelines, as the pipeline will fail if any command returns non-0.

Additionally, the pattern in the find has to be more restrictive, otherwise you would validate the schema.yaml against itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants