wikimedia / composer-merge-plugin

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

adding exclude feature #258

Open MiguelAPerez opened 1 year ago

MiguelAPerez commented 1 year ago

Description

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 excluding multiple paths.

Note: Different variations of using ! has been considered but non has work so far

What’s The Change ?

To get around this and not change how includes works, excludes removed patterns and/or files from being processed.

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