Skip to content

pin add rewrites pin.yaml into flow-style YAML #4

@andrew

Description

@andrew

Starting from `pin init` output:

```yaml
out: "internal/server/static/vendor"

assets: []
```

After `pin add diff2html bundles/css/diff2html.min.css bundles/js/diff2html-ui.min.js`:

```yaml
out: "internal/server/static/vendor"
assets: [{name: diff2html, version: ^3.4, files: [bundles/css/diff2html.min.css, bundles/js/diff2html-ui.min.js]}]
```

The blank line is gone and the assets list is collapsed to flow style. With three or four entries this becomes a single unreadable line, and hand-editing (which the README encourages: "append to the manifest at alphabetic position") gets awkward. It also produces a noisy diff on every `pin add` because the whole `assets:` line changes.

If the manifest stays YAML, `pin add` should emit block style with one entry per item, matching the README examples. If #1 lands and the manifest becomes JSON this is moot, though the equivalent there would be pretty-printed with one entry per array element rather than a single line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions