Skip to content

convert: proper ziggy output formatting#59

Open
LewisGaul wants to merge 3 commits into
kristoff-it:mainfrom
LewisGaul:convert-restructure
Open

convert: proper ziggy output formatting#59
LewisGaul wants to merge 3 commits into
kristoff-it:mainfrom
LewisGaul:convert-restructure

Conversation

@LewisGaul

Copy link
Copy Markdown
Contributor

The ziggy convert command currently gives unformatted output, which is because the ziggy output is constructed manually rather than going via an AST (see #52). This is a short-term fix that creates an AST from the manually constructed ziggy, which serves to validate the constructed output and provide formatting guaranteed to match ziggy fmt.

Using this example json file:

$cat example3.json
[
  {
    "name": "Katheryn McDaniel",
    "address": "138 Almond Street, Topeka, Kansas 20697",
    "email": "KateMcD@aol.com",
    "additional-roles": [ "board member" ]
  }
]

Previous output:

$ziggy convert --stdin json < example3.json
[{"name":"Katheryn McDaniel","address":"138 Almond Street, Topeka, Kansas 20697","email":"KateMcD@aol.com","additional-roles":["board member",],},]

New output:

$zig build run -- convert --stdin json < example3.json
[
    {
        "name": "Katheryn McDaniel",
        "address": "138 Almond Street, Topeka, Kansas 20697",
        "email": "KateMcD@aol.com",
        "additional-roles": [
            "board member",
        ],
    },
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant