Skip to content

Handle long task names in --list output#1072

Open
cyphercodes wants to merge 2 commits into
pyinvoke:mainfrom
cyphercodes:fix-list-long-task-width-1071
Open

Handle long task names in --list output#1072
cyphercodes wants to merge 2 commits into
pyinvoke:mainfrom
cyphercodes:fix-list-long-task-width-1071

Conversation

@cyphercodes
Copy link
Copy Markdown

Summary

  • Prevent --list column wrapping from using a non-positive description width when task names consume the terminal width.
  • Add a regression test covering an issue-length task name at 80 columns.

Verification

  • uv run pytest tests/program.py -k long_task_names_may_exhaust_terminal_width
  • uv run pytest tests/program.py
  • uv run inv test
  • uv run flake8 --exclude=.venv,invoke/vendor,sites,.git,build,dist,alt_env,appveyor,.cci_pycache .
  • uv run mypy invoke/program.py
  • git diff --check

Fixes #1071

@cyphercodes
Copy link
Copy Markdown
Author

Pushed a tiny coverage-hygiene follow-up for the Codecov patch failure.

Change:

  • Marked the dummy task body in the new --list regression test as # pragma: no cover, since --list intentionally inspects the task metadata without executing that body.

Local verification:

  • uv run flake8 tests/program.py
  • uv run pytest tests/program.py -q ✅ (122 passed, 2 skipped)
  • git diff --check

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.

Long tasks name make invoke --list | grep a crash with "invalid width"

1 participant