Skip to content

Glob wildcard pattern not honored #9561

Description

@chrispmcgee

Bug Report

Subject Details
Rector version v2.2.14

Skipping a rule with regular paths works fine:

    ->withSkip([
        StringClassNameToClassConstantRector::class => [__DIR__ . '/tests/Architecture'],
    ]);

However, when using a glob pattern (fnmatch?), it does not skip the file:

    ->withSkip([
        RequestStaticValidateToInjectRector::class => [
            __DIR__ . '/tests',
            __DIR__ . '/Modules/*/tests',
        ],
    ]);

The rector still changes the files in the various modules' tests directories. (Using Laravel Modules, btw.)

Minimal PHP Code Causing Issue

It's not really reproducible with the online tester because there is no file path for the demo PHP snippet, but here's a close representation:

https://getrector.com/demo/c51e0c83-92f8-4508-a10a-a9d45b2b5e5a

Expected Behaviour

Any file in the root /tests directory, as well as somewhere inside a tests directory under all of the module directories (Modules/Carriers/tests/…, Modules/Loads/tests/…, Modules/Users/tests/…, etc.) should not have the specified rule applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions