Skip to content

Add a --progress progress-bar option#1731

Merged
rolandwalker merged 1 commit intomainfrom
RW/add-batch-progress-bar
Mar 27, 2026
Merged

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

Conversation

@rolandwalker
Copy link
Copy Markdown
Contributor

@rolandwalker rolandwalker commented Mar 21, 2026

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.

Incidentally convert a neighboring string to triple quotes since it contained both single and double quotes.

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 .

@rolandwalker rolandwalker self-assigned this Mar 21, 2026
@github-actions
Copy link
Copy Markdown

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).

@rolandwalker rolandwalker force-pushed the RW/add-batch-progress-bar branch 3 times, most recently from c0180a7 to ea9c5a8 Compare March 26, 2026 09:24
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.

Incidentally convert a neighboring string to triple quotes since it
contained both single and double quotes.
@rolandwalker rolandwalker force-pushed the RW/add-batch-progress-bar branch from ea9c5a8 to bde0c16 Compare March 27, 2026 19:39
@rolandwalker rolandwalker merged commit 54f738f into main Mar 27, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/add-batch-progress-bar branch March 27, 2026 20:36
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