Skip to content

Add progress bar to the run command #441

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

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

greg0ire
Copy link
Contributor

@greg0ire greg0ire commented Jul 3, 2023

This adds a progress bar based on how many documents are being processed.

This is not always possible depending on the capabilities of the current OutputInterface interface implementation, which it is conditionally created.

For instance, when running tests, you get a BufferedOutput, which does not have the section capability.

Closes #297

@greg0ire greg0ire marked this pull request as ready for review July 3, 2023 14:30
@@ -10,10 +10,10 @@

final class RenderCommand
{
/** @param DocumentNode[] $documents */
/** @param iterable<DocumentNode> $documents */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

iterate returns a generator, but looking at the rest of a project, the fact that getDocuments() is an array is never used.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be fine then

Copy link
Contributor

@linawolf linawolf left a comment

Choose a reason for hiding this comment

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

Looks good to me

@linawolf linawolf requested a review from jaapio July 3, 2023 18:02
@jaapio
Copy link
Member

jaapio commented Jul 3, 2023

Maybe we should add commandline flag to hide the progress bar.

Like --no-progress. As progress bars can break the console output when this is very verbose. ?

@greg0ire
Copy link
Contributor Author

greg0ire commented Jul 3, 2023

You're right, I'll work on that 👍

This adds a progress bar based on how many documents are being
processed.

This is not always possible depending on the capabilities of the current
OutputInterface interface implementation, which it is conditionally
created.

For instance, when running tests, you get a BufferedOutput, which does
not have the section capability.
@greg0ire
Copy link
Contributor Author

greg0ire commented Jul 3, 2023

@jaapio done 🙂

@jaapio
Copy link
Member

jaapio commented Jul 3, 2023

Thanks you rock!

@jaapio jaapio merged commit a9281e7 into phpDocumentor:main Jul 3, 2023
@greg0ire greg0ire deleted the progress-bar branch July 3, 2023 20:18
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.

Add progress bar to cli
3 participants