← Back to issue list

Add `charmcraft fmt` command

View original Github issue

Metadata

Project
charmcraft
Number
#913
Type
issue
State
open
Author
sed-i
Labels
Created
Updated
Closed

Current evaluation

Feature request for a charmcraft format command to apply opinionated YAML formatting to metadata.yaml, actions.yaml, config.yaml, and charmcraft.yaml. Triaged by maintainer who created a forum post for consensus; no implementation yet after over a year of inactivity.

Suggested action: keep open

Reason: Maintainer facundobatista triaged this in Nov 2022, agreed on naming it 'format' with a --diff option, and created a forum post to gather community consensus on formatting rules. The feature remains relevant and unimplemented (verified no format command exists in the codebase), but has been inactive for over a year pending that external consensus. Not stale-irrelevant, just deprioritized.

Impact: 30 Quick Win: 18.0 Staleness: 65 Complexity: 40 Confidence: 70 Support Request: 5

Issue body

It could be handy if charmcraft had an `fmt` command to apply a set of opinionated formatting choices. For example: - Sort metadata.yaml sections in a particular order, e.g. name - assumes - summary - description - ... - One line gap between each main section and no gaps anywhere else - actions.yaml and config.yaml entries sorted alphabetically - charmcraft.yaml: bases before parts; parts sorted by order of business. - etc.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 30
Quick Win: 18.0
Staleness: 65
Complexity: 40
Confidence: 70
Support Request: 5
keep open Feature request for a charmcraft format command to apply opinionated YAML formatting to metadata.yaml, actions.yaml, config.yaml, and charmcraft.yaml. Triaged by maintainer who created a forum post for consensus; no implementation yet after over a year of inactivity.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 55
Confidence: 75
Support Request: 10
close stale Request for a charmcraft format command to apply consistent, opinionated formatting to charm YAML files. Maintainers discussed scope and created a forum post for consensus, but the issue has been inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 45
Confidence: 80
Support Request: 10
needs triage Proposal to add a format command to charmcraft for enforcing consistent formatting on charm metadata and config files. Currently awaiting consensus from a Discourse discussion initiated in late 2022.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 45
Confidence: 80
Support Request: 0
keep open Feature request to add a charmcraft format command for opinionated formatting of charm files. Maintainers are interested and have opened a forum discussion to define formatting rules before implementation.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 40
Confidence: 60
Support Request: 10
keep open Proposes adding a format command to charmcraft for consistent, non-semantic YAML formatting across charm files. Maintainers created a forum post to gather consensus on scope and rules. Awaiting community feedback to formalize implementation.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#940 Add yaml formatting feature in charmcraft status charmcraft closed The request to add YAML formatting to charmcraft status was abandoned. The maintainer clarified the format flag is for machine consumption, not human readability. The author agreed and closed the issue.
75%
#722 Feature request: charmcraft revisions json / yaml output charmcraft closed Closed and superseded by issue #183, which tracks broader programmatic output support for charmcraft commands including JSON and YAML formatting.
72%
#933 Update the charmcraft status --format charmcraft merged Merged after the author removed YAML formatting support per reviewer feedback, keeping only the help text update for the --format option. The PR was approved and merged following the requested changes.
71%