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

[FEATURE REQUEST] Add support for glob patterns #165

Open
olunusib opened this issue Aug 23, 2024 · 8 comments · May be fixed by #179
Open

[FEATURE REQUEST] Add support for glob patterns #165

olunusib opened this issue Aug 23, 2024 · 8 comments · May be fixed by #179
Assignees
Labels
CLI Update to the CLI hacktoberfest 🎃 Hacktoberfest 2024 help wanted Extra attention is needed validator-core Issues that relate to the core validator functionality

Comments

@olunusib
Copy link

olunusib commented Aug 23, 2024

Description

Add support for glob patterns to allow more flexible and precise file matching

Examples:

validator "**/*.json" # validate all json files

validator "config/**/*_prod.yaml"  # validate only YAML files with '_prod' in their name within the config directory
@kehoecj
Copy link
Collaborator

kehoecj commented Aug 27, 2024

@olunusib Great suggestion! Just to make sure I'm understanding your first example (validator "**/*.json" # validate all json files) how does that differ from the functionality today?

@kehoecj kehoecj added CLI Update to the CLI help wanted Extra attention is needed validator-core Issues that relate to the core validator functionality labels Aug 27, 2024
@ccoVeille
Copy link
Contributor

I would suggest using doublestar

@olunusib
Copy link
Author

True, the first example is already doable with an extra flag

@anya004
Copy link

anya004 commented Sep 29, 2024

@olunusib @kehoecj what flag are you referring to for the first example?

@kehoecj kehoecj added the hacktoberfest 🎃 Hacktoberfest 2024 label Oct 2, 2024
@kehoecj
Copy link
Collaborator

kehoecj commented Oct 2, 2024

@anya004 Looking at this more there's actually not a great way to target only one file type so I think the glob pattern makes sense. In order to target only a single config type you'd have to exclude all available types like this validator --exclude-type=xml,yaml,.... Looking at it further we also don't provide a list of types that are visible outside of the code. I'll create a separate issue for that.

@timwehrle
Copy link

@kehoecj I can look into it. Would integrate the doublestar library mentioned above.

@anya004
Copy link

anya004 commented Oct 11, 2024

@timwehrle I started looking into it and will have a PR ready today!

@timwehrle
Copy link

@anya004 If you need additional help, reach out :)

@anya004 anya004 linked a pull request Oct 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Update to the CLI hacktoberfest 🎃 Hacktoberfest 2024 help wanted Extra attention is needed validator-core Issues that relate to the core validator functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants