Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 8, 2025

Description

@rodrigoprimo and me came across this while debugging something completely different.

Turns out the split between fixable/fixed error vs warnings, which was necessary in 4.0 to allow for the exit code change, was breaking the progress bar display when parallel processing was enabled.

Basically, parallel processing "mocks" the accumulated fixable/fixed error and warning counts via a DummyFile before calling Runner::printProgress(). Then the Runner::printProgress() method calls the File::getFixed() method, however, that method doesn't look at the "split" fixed counts, but at the accumulated total fixes, but as this is a mocked DummyFile, that number will always be 0.

IIRC, updating the File::getFixed() method to calculate the number based on the split fixed errors and warnings was breaking other things, which is why it was left as-is.

The down-side of that, as we now discovered, is that the progress bar when running in parallel would always just show a . and not the F when files were fixed.

Either way, this should be fixed now.

Includes a test via the new bashunit end-to-end testsuite.

Suggested changelog entry

Fixed: progress bar wasn't showing files as fixed when running phpcbf in parallel mode.

Rodrigo and me came across this while debugging something completely different.

Turns out the split between fixable/fixed error vs warnings, which was necessary in 4.0 to allow for the exit code change, was breaking the progress bar display when parallel processing was enabled.

Basically, parallel processing "mocks" the accumulated fixable/fixed error and warning counts via a `DummyFile` before calling `Runner::printProgress()`.
Then the `Runner::printProgress()` method calls the `File::getFixed()` method, however, that method doesn't look at the "split" fixed counts, but at the accumulated total fixes, but as this is a mocked `DummyFile`, that number will always be `0`.

IIRC, updating the `File::getFixed()` method to calculate the number based on the split fixed errors and warnings was breaking other things, which is why it was left as-is.

The down-side of that, as we now discovered, is that the progress bar when running in parallel would always just show a `.` and not the `F` when files were fixed.

Either way, this should be fixed now.

Includes a test via the new bashunit end-to-end testsuite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant