symplify / monorepo-builder

Composer tools to maintain a monorepo

Home Page:https://www.tomasvotruba.cz/blog/2019/02/18/how-we-automated-shopsys-packages-release-from-2-days-to-1-console-command/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Needless check for file existence hinders excludes setting

elpadi opened this issue · comments

Hi,

The TLDR for this issue is: Why do we need an Assert::allFileExists check for the packageDirectoriesExcludes config setting? And can we please remove it?

Assert::allFileExists($packageDirectories);

I'm guessing that was copy / pasted from the packageDirectories method, where it makes a lot more sense.

Context

I'm trying to add some pattern based excludes to the config. I'm using this tool to manage a WordPress site made up of a bunch of plugins and themes where each one is a composer package, and not being able to exclude composer.json files found in wp-content sub-directories is a huge pain point.

For those not familiar with the code, that config option goes straight into Symfony file finder ->exclude(...) which is meant to accept patterns. So again, I don't understand why we're limiting ourselves here.

if ($this->packageDirectoriesExcludes !== []) {
$finder->exclude($this->packageDirectoriesExcludes);
}

I commented out the check in my local and it doesn't seem to have any negative side effects.

P.S. Thanks for this awesome tool, it's been very helpful for us in trying to better organize our code.

Thank for your issue, I agree your point. Can you turn it to PR?