`humanize_list` does not properly handle two-item lists.
Metadata
Current evaluation
Fixed in canonical/craft-cli#425 (c7a1d2b): two-item lists now render as "a and b", while longer lists retain serial commas.
Resolution: closed resolved
Reason: PR canonical/craft-cli#425 was merged as commit c7a1d2b. It corrected two-item formatting and added unit tests covering two-item and longer lists.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
Because `humanize_list` insists on a serial comma, a two-item list is incorrectly converted.
### To Reproduce
```
>>> craft_cli.utils.humanize_list(["a", "b"])
'a, and b'
```
### part yaml
```shell
```
### Relevant log output
```shell
n/a
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed in canonical/craft-cli#425 (c7a1d2b): two-item lists now render as "a and b", while longer lists retain serial commas. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in canonical/craft-cli#425 (c7a1d2b): two-item lists now render as "a and b", while longer lists retain serial commas. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without a documented resolution or linked pull request. The report was synced to Jira (CRAFT-4987) and appears abandoned. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without a code fix. The report was synced to internal Jira ticket CRAFT-4987 for tracking. No resolution or merge details were provided. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed after triaging and Jira sync. Appears abandoned or resolved externally, as no fix or resolution is documented. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-cli#425
(confidence 100%)
Merged fix commit c7a1d2b resolves the incorrect serial comma in two-item lists.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #425 fix(utils): correct humanize_list formatting for two-item lists | craft-cli | merged | Merged: commit c7a1d2b "fix(utils): correct humanize_list for two-item lists (#425)" makes two-item lists render as "a and b" (no serial comma), keeps serial commas for longer lists, and adds unit tests. | |
| #412 `humanize_list` output is incorrect when list contains only one item | craft-cli | closed | Fixed in merged PR #425 (commit c7a1d2b). humanize_list now returns the sole item for 1-element lists (plus 'a and b' for two items), with new unit tests in tests/unit/test_utils.py. |