-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Improve stack trace when running the tool with parallel runner #8038
Comments
I agree, transferring complex data like a whole stack trace between child/parent processes wouldn't be reasonable. Though, with Maybe, instead of passing the whole stack trace from child to parent, it could be possible to transfer the file name only. Provided that is it possible at all to detect the source of an exception from the parent process. As an example, the output of the linked issue could then look something like this:
With this information we would at least know if the issue is caused in our project's code and where to look for debugging purposes. |
All I see in the linked issue is that you used |
Sure thing, here you go: Non-verbose> .\vendor\bin\php-cs-fixer check test.php --using-cache=no --rules=simplified_null_return
Verbose (
|
Ah OK, now I understand. It's not a worker error (unhandled), but a process error that is caught during the process, serialised on worker's side and reported to the main process, so the mentioned
Even if we add original stack trace to the payload sent from the worker to the main process, we can't recreate it within recreated exception/error, it's just not possible in PHP. And since @keradus are you open to such changes in the |
If I understand you right, you want to replace: - public function __construct(int $type, string $filePath, ?\Throwable $source = null, array $appliedFixers = [], ?string $diff = null)
+ public function __construct(int $type, string $filePath, ?ErrorSourceDTO$source = null, array $appliedFixers = [], ?string $diff = null) , where class ErrorSourceDTO {
var $msg, $code, $trace;
} ? if so, I'm tentatively OK with it, but would need to see implementation draft. I am also OK to have sth smaller, like a msg on parallel execution error, eg |
Since this issue has not had any activity within the last 90 days, I have marked it as stale. The purpose of this action is to enforce backlog review once in a while. This is mostly for maintainers and helps with keeping repository in good condition, because stale issues and PRs can accumulate over time and make it harder for others to find relevant information. It is also possible that some changes has been made to the repo already, and issue or PR became outdated, but wasn't closed for some reason. This action helps with periodic review and closing of such stale items in automated way. You may let maintainers handle this or verify current relevancy by yourself, to help with re-triage. Any activity will remove stale label so it won't be automatically closed at this point. I will close it if no further activity occurs within the next 30 days. |
Feature request
Since version 3.57.0 we are running PHP CS Fixer in parallel with great success. Though, we've encountered an issue while using the parallel runner: The stack trace when running into errors is kind of useless in parallel mode. Using
--sequential
resolves this issue and returns a meaningful stack trace again.It would be great to have a similar stack trace when using the parallel runner.
Please have a look at this issue for an exemplary error:
simplified_null_return
errors out withTypeError: Illegal offset type
#8037Stack trace when using sequential execution:
Stack trace when using parallel execution:
Link to Discussion where feature request was formed
No response
Contribution Checks
The text was updated successfully, but these errors were encountered: