← Back to issue list

Utility to allow a `format` option for commands.

View original Github issue

Metadata

Project
craft-application
Number
#342
Type
issue
State
open
Author
lengau
Labels
Created
Updated
Closed

Current evaluation

Feature request from maintainer lengau to add a unified format option utility (add_format_argument, emit_formatted_output) for tabular command outputs. No labels, no implementation found in codebase, last activity was a bot Jira ticket 465 days ago.

Suggested action: needs triage

Reason: The issue has no labels, no assignee, and no maintainer response beyond the automated Jira bot comment from 2024-05-09. No implementation of add_format_argument, emit_formatted_output, or tabulate integration exists in the current codebase. It is a valid, well-scoped feature request that simply has not been categorised or prioritised by a maintainer.

Impact: 35 Quick Win: 19.25 Staleness: 72 Complexity: 45 Confidence: 78 Support Request: 0

Issue body

### What needs to get done Add utilities of some form to make it easy for commands to add a unified `format` option for various tabular command outputs. Ideally a command's `fill_parser` method would be able to do something like: ``` utils.add_format_argument(parser) ``` and then we'd have a related function that actually emits the formatted message, something like: ``` def emit_formatted_output(format: FormatValue, headers: Sequence[str], data) -> None: ... ``` Here the `data` object would need to be something that can (at minimum) be used by [tabulate](https://pypi.org/project/tabulate/) and be serialised into JSON. With those two formats, we'd likely get the ability to do other formats (e.g. YAML, toml) if we decide to add that in the future. ### Why it needs to get done This got added to the `names` command in snapcraft recently: https://github.com/canonical/snapcraft/pull/4778 Charmcraft has a [partial implementation](https://github.com/canonical/charmcraft/blob/e2ad204f828a4ef387090d3e626f0f6db34e5996/charmcraft/application/commands/base.py#L33), but still relies on the command itself being aware of each format.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 35
Quick Win: 19.25
Staleness: 72
Complexity: 45
Confidence: 78
Support Request: 0
needs triage Feature request from maintainer lengau to add a unified format option utility (add_format_argument, emit_formatted_output) for tabular command outputs. No labels, no implementation found in codebase, last activity was a bot Jira ticket 465 days ago.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 60
Confidence: 85
Support Request: 10
needs triage Feature request to add a unified `format` option utility for commands, enabling consistent tabular output formatting across the project. Currently unlabelled and awaiting triage.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 30
Confidence: 80
Support Request: 10
needs triage Feature request to create a utility for a unified format CLI option across commands, enabling tabular output in JSON, YAML, TOML, etc. Open since 2023 with minimal maintainer interaction and an internal Jira ticket linked.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 40
Confidence: 80
Support Request: 5
needs triage Proposes a utility to standardize a format argument for command outputs, supporting JSON and tabular data. Open, unassigned, and inactive for over a year. Linked to Jira ticket CRAFT-2908. Awaiting triage and implementation.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.