Open reegnz opened 1 month ago
Golang's default glob doesn't actually support **
: https://github.com/golang/go/issues/11862. To support this, we'd likely need to use github.com/bmatcuk/doublestar.
I think we'd be open to a potential contribution here if you'd like, but internally regexes work quite well for us.
I'll see if I can make that change and send a PR for it.
When working with files, policy-bot should be providing basic glob support.
When working with common unix tools, glob-support tends to be either built-in, or augmented by the wrapping shell evaluating globs. It's not that common using regex to match filename patterns.
Using filename pattern matching is arguable also more secure than raw regex.
Please support either globs or gitignore patterns (which also resemble globs).
Seems like go has glob functionality already built into it's standard library, and is much more performant in matching filenames than regex: https://github.com/golang/go/blob/master/src/path/filepath/match.go#L44
I imagine config could look like this: