Boeing / config-file-validator

Cross Platform tool to validate configuration files
https://boeing.github.io/config-file-validator/
Apache License 2.0
348 stars 71 forks source link

[FEATURE REQUEST] Add support for glob patterns #165

Open olunusib opened 2 months ago

olunusib commented 2 months ago

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 commented 2 months ago

@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?

ccoVeille commented 2 months ago

I would suggest using doublestar

olunusib commented 2 months ago

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

anya004 commented 1 month ago

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

kehoecj commented 1 month ago

@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 commented 1 month ago

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

anya004 commented 1 month ago

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

timwehrle commented 1 month ago

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