-
-
Notifications
You must be signed in to change notification settings - Fork 737
Description
Bug Report
Rector version v2.0.15
MacOS 15.4.1
Description
If a directory in the scan path contains a literal * character in its name (e.g., com.example.* ), Rector incorrectly interprets it as a glob pattern. This causes the following fatal error even when no globbing is used in the rector.php config or CLI arguments:
Matching file paths by using glob-patterns is no longer supported. Use specific file path instead.
Use case:
I list all my clients with reverse dot notation on my computer, one of my projects runs on multiple subdomains so the natural reverse dot notation is com.example.*/projectName/projectDirectory, if rector is run in projectDirectory the asterisk after ‘example’ is interpreted as a glob.
Minimal PHP Code Causing Issue
Irrelevant, any Rector command including vendor/bin/rector --version will trigger the error, no php code needed.
Expected Behaviour
Any of these solutions would work, and there’s also probably better solutions someone more familiar with the project could suggest. (First time user here)
- Sanitize/escape path names that are not passed into rectors configs (a path passed into the config should trigger this error)
- Echo the path that threw the error with the error
- Use project relative paths, and use anything above the project directory as a literal allowing the OS/CLI to throw the error if needed.
Edit: Formatting