← Back to issue list

feat(names) add --format option

View original Github issue

Metadata

Project
snapcraft
Number
#4778
Type
pull request
State
merged
Author
DanielDewberry
Labels
—
Created
Updated
Closed

Current evaluation

PR #4778 merged as commit 42046b524, adding --format table|json to snapcraft names, retaining table as default and adding tests for both modes.

Resolution: closed resolved

Reason: PR #4778 was merged into main as commit 42046b524. The change enables JSON output while preserving the existing table format.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Add --format option to snapcraft names to enable output format selection. Possible choices are: - table (default, existing behaviour) - json tests/unit/commands/test_names.py: - Add test class TestNames. - Rename test_names to test_table and move it into the scope of TestName. Add format to argparse.Namespace. - Add test_json to TestNames. - [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `tox run -m lint`? - [x] Have you successfully run `tox run -e test-py310`? (supported versions: `py39`, `py310`, `py311`, `py312`) ----- The motivation for adding JSON formatted output to the names sub-command, is that of data pipelines. It will enable tooling to read the command output and leverage JSON parsers rather than performing text processing. A small quality of life improvement :) The JSON structure leaves room for extension if subsequently required: ```json { "snaps": [ { "name": "test-snap-private", "since": "2016-07-26T20:18:32Z", "visibility": "private", "notes": "-", }, ] } ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved PR #4778 merged as commit 42046b524, adding --format table|json to snapcraft names, retaining table as default and adding tests for both modes.
stealth/space-bunny-alpha — closed resolved Merged PR #4778 as commit 42046b524, adding --format table|json to snapcraft names; table remains the default and JSON enables machine-readable output.
stealth/space-bunny-alpha — closed resolved Merged PR #4778 as commit 42046b524, adding --format table|json to snapcraft names (table remains default), with unit tests for both output modes.
stealth/space-bunny-alpha — closed resolved Merged in canonical/snapcraft#4778 (commit 42046b524), adding --format to names with default table and JSON output plus unit tests.
qwen/qwen3.6-35b-a3b — — Merged addition of a --format option to snapcraft names, enabling table (default) and JSON output for data pipelines. Approved by reviewers, passed CI, and resolved CLA issues. Includes unit tests.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Added a --format option to the snapcraft names command, enabling JSON output alongside the default table format. Unit tests were included. Maintainers recommended generalizing this feature to other commands via a separate issue.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.