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

[dx] Add --only-suffix to filter files by suffixes #6647

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Jan 5, 2025

@TomasVotruba TomasVotruba merged commit 7fc9494 into main Jan 5, 2025
41 checks passed
@TomasVotruba TomasVotruba deleted the tv-only-suffix branch January 5, 2025 08:59
@@ -70,7 +74,7 @@ function (string $file): bool {

// filtering files in directories collection
$directories = $this->fileAndDirectoryFilter->filterDirectories($filesAndDirectories);
$filteredFilePathsInDirectories = $this->findInDirectories($directories, $suffixes, $sortByName);
$filteredFilePathsInDirectories = $this->findInDirectories($directories, $suffixes, $sortByName, $onlySuffix);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should check on $filteredFilePaths variable as well.

I am currently on mobile, i will check when I back to PC.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's necessary, as explicit files should be always used. That's the behavior I'd expect :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The files can be registered via withPaths(), which means unrelated to the --only-suffix use, show invalid expectation, eg --only-suffix=controllers, but rector.php and .php_cs_fixer.php also changed.

It should either check for both $filteredFilePaths and $filteredFilePathsInDirectories, or filter in final collection files result.

I will create new PR with what I mean.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see PR:

for include other files unrelated to the --ony-suffix in the configration of paths provided.

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

Successfully merging this pull request may close these issues.

[DX] Add --only-suffix option to filter files by suffix
2 participants