Skip to content

[TASK] Take glob pattern for files into account#6376

Closed
sabbelasichon wants to merge 2 commits intorectorphp:mainfrom
sabbelasichon:glob-pattern-for-files
Closed

[TASK] Take glob pattern for files into account#6376
sabbelasichon wants to merge 2 commits intorectorphp:mainfrom
sabbelasichon:glob-pattern-for-files

Conversation

@sabbelasichon
Copy link
Copy Markdown
Contributor

For now you cannot use the glob pattern on a file basis. But as we now have the FileProcessors it would be awesome to speed up the processing by selecting also files with a glob pattern

@sabbelasichon sabbelasichon force-pushed the glob-pattern-for-files branch from 51b65ee to 24816d1 Compare May 6, 2021 15:46
@TomasVotruba
Copy link
Copy Markdown
Member

Hi, I like it 👍

This behavior should be already handled in this method:
https://github.com/rectorphp/rector/pull/6376/files#diff-c1b4d526cfa7d17990bde4cf0146bcf748e35382d13d14ca350a21820d2df256R107

Could you check it if there is some bug?

@sabbelasichon
Copy link
Copy Markdown
Contributor Author

sabbelasichon commented May 6, 2021

Maybe it is a feature and not a bug ;-)

But for now only glob pattern for directories is allowed. File patterns have to be real file paths.
https://github.com/rectorphp/rector/blob/main/src/FileSystem/FilesystemTweaker.php#L53
https://github.com/symplify/smart-file-system/blob/main/src/FileSystemFilter.php#L32

@TomasVotruba
Copy link
Copy Markdown
Member

I see. It should be merged in one service, now we have 2 do to the glob job.

@sabbelasichon
Copy link
Copy Markdown
Contributor Author

I know. But i was scared to change it in the other package due to side effects.

@TomasVotruba
Copy link
Copy Markdown
Member

TomasVotruba commented May 6, 2021

Go for it 👍 It should be a new glob-something service. Other packages can use it too, like ECS

@sabbelasichon sabbelasichon force-pushed the glob-pattern-for-files branch from 24816d1 to aba1c35 Compare May 7, 2021 10:37
@sabbelasichon
Copy link
Copy Markdown
Contributor Author

sabbelasichon commented May 7, 2021

I have streamlined the globbing without creating a whole new service. Not sure how to start without opening Pandora's Box which takes too much time for me right now.

@sabbelasichon sabbelasichon force-pushed the glob-pattern-for-files branch from aba1c35 to 40c5d46 Compare May 7, 2021 10:41
@TomasVotruba
Copy link
Copy Markdown
Member

Hi Sebastian, it looks good to me 👍

Could you move the PR to https://github.com/rectorphp/rector-src?

I'll process it there :)

sabbelasichon added a commit to sabbelasichon/rector-src that referenced this pull request May 11, 2021
TomasVotruba pushed a commit to rectorphp/rector-src that referenced this pull request May 12, 2021
TomasVotruba added a commit that referenced this pull request Oct 12, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants