composer-attribute-collector
composer-attribute-collector copied to clipboard
Feature request: include/exclude paths to handle glob
For big monoliths, it would be handy to be able to use the glob pattern when including/excluding.
For instance, instead of
{
"extra": {
"composer-attribute-collector": {
"exclude": [
"apps/admin/tests/",
"apps/main/tests/",
"components/colors/tests/",
"components/http/tests/",
"components/math/tests/"
]
}
}
}
we would have
{
"extra": {
"composer-attribute-collector": {
"exclude": [
"apps/**/tests/",
"components/**/tests/"
]
}
}
}
Hi @BafS, thanks for the suggestion. Currently, the pattern is passed to preg_quote() to build a RegExp. We have a couple of options:
- I convert
**into its RegExp equivalent. - Use a "Glob to RegExp" converter
- I allow RegExp in the pattern.
- ??
Allowing the regex would cover this, otherwise we could simply use the glob function (https://www.php.net/manual/en/function.glob.php).