[Performance] Use filtered filePaths from ApplicationFileProcessor::configurePHPStanNodeScopeResolver on WorkerRunner::run() #4513
Conversation
…igurePHPStanNodeScopeResolver()
| * @param string[] $filePaths | ||
| */ | ||
| public function configurePHPStanNodeScopeResolver(array $filePaths, Configuration $configuration): void | ||
| public function configurePHPStanNodeScopeResolver(array &$filePaths, Configuration $configuration): void |
There was a problem hiding this comment.
looks like after this method was called the "correct list" of files should be contained in $this->nodeScopeResolver->setAnalysedFiles().
could the caller of configurePHPStanNodeScopeResolver get it from there?
There was a problem hiding this comment.
I updated to return file paths instead 9b38ba5
|
thanks for investigating. the fix makes sense. I was not able to verify the fix yet. is this something which can be unit tested? |
|
There are 2 process:
I am not sure if unit test is possible, probably e2e is needed and possibly need in separate PR if needed, but seems the change should already clear :). I will merge it as is and let you test dev-main fo it |
|
All checks have passed 🎉 @TomasVotruba @staabm let's merge and test 👍 |
|
thank you |
|
@staabm if you want to debug/test, you need to move $filePaths = $this->applicationFileProcessor->configurePHPStanNodeScopeResolver($filePaths, $configuration);
+var_dump($filePaths); |
|
@TomasVotruba it seems make progress bar only got 99% while actually 100% already, Ref https://github.com/rectorphp/rector-src/actions/runs/5557453961/jobs/10151262337#step:11:28 I will cherry-pick progress bar tweak from 88a755b |
|
@TomasVotruba @staabm it seems for both parallel and non-parallel process; filePaths should be filtered early, so total counts will make always correct, so move this: rector-src/src/Application/ApplicationFileProcessor.php Lines 78 to 79 in 9217e0d before if check rector-src/src/Application/ApplicationFileProcessor.php Lines 74 to 75 in 9217e0d I will try tomorrow, now I need to sleep |
@TomasVotruba @staabm this is to ensure no need to read unsupported file extensions:
Before
After
Fixes rectorphp/rector#8056