Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is blacklist setting supposed to act as a pattern ? #1422

Open
llaville opened this issue Nov 7, 2024 · 5 comments
Open

Is blacklist setting supposed to act as a pattern ? #1422

llaville opened this issue Nov 7, 2024 · 5 comments
Labels

Comments

@llaville
Copy link
Contributor

llaville commented Nov 7, 2024

Hello,

Working on my project https://github.com/llaville/php-compatinfo-db that use Doctrine, I've recently found a possible bug.

I wanted to have control on files/dirs included, so I've removed the force-autodiscovery setting (https://github.com/llaville/php-compatinfo-db/blob/6.12/box.json#L3), and replace it by :

{

    "blacklist": [
        "tests",
        "Test",
        "dist",
        "doc",
        "vendor-bin"
    ],
    "directories": [
        "bin",
        "src",
        "config",
        "data",
        "vendor"
    ],
    "directories-bin": [
        "resources"
    ],
    "files": [
        "autoload.php"
    ]

}

But with blacklist/doc it also excluded to add my vendor/doctrine folder with contains Doctrine DBAL and ORM dependencies.

So the question is : Is blacklist setting supposed to act as a pattern ? or is it a bug ?

If it's not a bug, the BOX documentation should explains it

@theofidry
Copy link
Member

According to this test it is: https://github.com/box-project/box/blob/main/tests/Configuration/ConfigurationFileTest.php#L39

I'm not sure having a cursory look at the code though.

So it should be clarified in the docs.

@llaville
Copy link
Contributor Author

llaville commented Nov 7, 2024

@theofidry I don't think the test match my context. I've added doc in blacklist setting (my goal is to avoid documentation folder to be included), but it excludes also part of directory that have the same entry.

doc exclude the vendor/doctrine folder

@theofidry
Copy link
Member

Ah ok I did not get that. Yes indeed it's 100% a bug then, possibly one that's always been there 😅

@theofidry
Copy link
Member

As a fallback: maybe using finders would be simpler in your case?

@theofidry theofidry added the bug label Nov 7, 2024
@llaville
Copy link
Contributor Author

llaville commented Nov 8, 2024

Alternative (I've adopted)
I've removed doc entry from blacklist, and I won't lost doctrine dependencies when I compile the PHAR with Box 4.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants