wikimedia / composer-merge-plugin

Merge one or more additional composer.json files at Composer runtime
MIT License
938 stars 160 forks source link

Request to expanding the includes features #259

Open MiguelAPerez opened 1 year ago

MiguelAPerez commented 1 year ago

Issue: While using the available includes features some limitations were found when trying to exclude patterns (due to glob). For example when using ! on a character group, each letter is ignored instead of the group:

"include": [
        "sub-projects/![FooProject]*/composer.json"
],

This will exclude sub-project/F*, sub-project/o*, sub-project/o*, sub-project/P*, etc from being processed. This issue also causes significant toil when trying excluding multiple paths.

Proposed Solution: To get around this and not change how includes works, I suggest implementing an excludes attribute. This attribute would array_diff on the includes and allow refined excludes patterns.

"include": [
        "sub-projects/*/composer.json"
],
"exclude": [
        "sub-projects/Foo*/composer.json"
],

Pull Request: https://github.com/wikimedia/composer-merge-plugin/pull/258