Skip to content

Add a --progress progress-bar option#1731

Open
rolandwalker wants to merge 1 commit intomainfrom
RW/add-batch-progress-bar
Open

Add a --progress progress-bar option#1731
rolandwalker wants to merge 1 commit intomainfrom
RW/add-batch-progress-bar

Conversation

@rolandwalker
Copy link
Contributor

Description

Add a --progress progress-bar option which only works in conjunction with --batch, not STDIN, as it needs to read over the file to count the number of goal statements.

Care is also taken that a plain file, not a FIFO, is passed to --batch.

Motivation: the bar might be pretty, but the real value-add for big jobs is the ETA on the right.

Followups: the new code should really go into a batch.py, but that is awaiting a refactor of the CLI arguments.

Example:

last image

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

which only works in conjunction with --batch, not STDIN, as it needs to
read over the file to count the number of goal statements.

Care is also taken that a plain file, not a FIFO, is passed to --batch.
@rolandwalker rolandwalker self-assigned this Mar 21, 2026
@github-actions
Copy link

No correctness or security regressions stood out in the PR diff (c1ef3d8...c5b535e).

Residual test gaps I’d still address:

  1. --progress fallback path is untested when stderr is not a TTY, even though behavior changes at main.py.
    Add a test to assert it still executes batch statements normally (without progress) and exits 0.

  2. --progress with --batch - (stdin batch input) is untested; current logic skips the progress branch entirely at main.py.
    Add a test to lock expected behavior (silent fallback vs warning), so future changes don’t regress UX.

  3. Error handling in the pre-count pass (ValueError from parser) is not covered for progress mode at main.py.
    Add a test with an overlong multiline statement to verify the intended error message and non-zero exit.

I couldn’t run pytest locally because pytest is not installed in this environment (command not found).

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.

1 participant