Stabilize tox by fixing Ruff/Pyright drift and restoring full coverage#308
Stabilize tox by fixing Ruff/Pyright drift and restoring full coverage#308
Conversation
Agent-Logs-Url: https://github.com/wolph/python-progressbar/sessions/7a92701d-42dc-4a5a-85a7-458e27ca00b2 Co-authored-by: wolph <270571+wolph@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wolph/python-progressbar/sessions/7a92701d-42dc-4a5a-85a7-458e27ca00b2 Co-authored-by: wolph <270571+wolph@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wolph/python-progressbar/sessions/7a92701d-42dc-4a5a-85a7-458e27ca00b2 Co-authored-by: wolph <270571+wolph@users.noreply.github.com>
|
/gemini review |
|
To use Codex here, create an environment for this repo. |
There was a problem hiding this comment.
Pull request overview
This PR stabilizes the project’s tox/CI checks by aligning linting/type-checking configuration, resolving newly enforced Ruff findings, and closing the remaining coverage gap without changing package behavior.
Changes:
- Removed an unsupported Pyright setting from
pyproject.tomlto eliminate config warnings. - Addressed Ruff/format drift in
progressbar/bar.py,progressbar/env.py, andprogressbar/__main__.pyto keep formatting stable across tools. - Added a targeted stream test to cover the
enable_colors=Trueupdate/output path and restore 100% coverage.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_stream.py |
Adds a focused regression test ensuring ANSI color sequences are preserved when enable_colors=True. |
pyproject.toml |
Removes an unsupported Pyright option to stop config warnings/failures. |
progressbar/env.py |
Tweaks f-string formatting for regex construction to prevent formatter churn. |
progressbar/bar.py |
Fixes Ruff findings (unnecessary cast, unused tuple element) and consolidates a warning string for stable formatting. |
progressbar/__main__.py |
Refactors parser description assignment to avoid repeated formatter rewrites. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request refactors the argument parser description in __main__.py, simplifies calculation logic and handles an unused variable in bar.py, and updates string formatting in env.py. It also removes an unnecessary type assertion setting in pyproject.toml and adds a new test case for color support in tests/test_stream.py. I have no feedback to provide.
The current tox run was failing for three separate reasons: new Ruff rules flagged existing code, Pyright emitted a config warning for an unsupported setting, and the test suite fell just short of the repository’s 100% coverage gate. This change brings those checks back into agreement without changing the public behavior of the package.
Lint/config alignment
reportUnnecessaryTypeAssertionPyright setting.progressbar/bar.pyby removing an unnecessaryint(...)cast and marking the unused resize tuple element explicitly.Coverage gap
enable_colors=Trueupdate path, covering the remaining uncovered branch in the bar output code.Formatter stability
blackandruff formatruns converge instead of rewriting the same files back and forth.