Skip to content

Use registered task names in JSON listings - #1107

Open
0xeriiic wants to merge 1 commit into
pyinvoke:mainfrom
0xeriiic:fix-json-task-registration-name
Open

0xeriiic wants to merge 1 commit into
pyinvoke:mainfrom
0xeriiic:fix-json-task-registration-name

Conversation

@0xeriiic

@0xeriiic 0xeriiic commented Dec 4, 2026

Copy link
Copy Markdown

When a task is registered with Collection.add_task(..., name="public_name"), invoke --list --list-format=json reports the underlying task name. For a default task, the top-level default field already uses the registered name, so consumers can receive two different names for the same task.

Use the collection's registered task names when serializing and sorting JSON task entries. The regression test checks that a renamed default task appears as public-name in both fields.

Tests: 91 collection tests passed on Windows with Python 3.13 using pytest --noconftest tests/collection.py -q. Also verified JSON output through Program.run.

OpenAI Codex assisted with reproducing the bug, writing the change and regression test, and preparing this draft.

AI assistance: OpenAI Codex.
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