dns icon indicating copy to clipboard operation
dns copied to clipboard

Add script for formatting/sorting YAML files

Open garyhtou opened this issue 1 year ago • 5 comments

This PR adds a bin/format script that uses bash and yq to format & sort the YAML files.

It first checks the zones in config/production.yaml to see which files contain DNS declarations. Then, it uses yq to sort the keys and pretty print.

The script also provides a small diffstat when ran.

garyhtou avatar Aug 13 '24 03:08 garyhtou

It looks like the dry run passed with the yq formatted files. That's a good sign!

garyhtou avatar Aug 13 '24 03:08 garyhtou

Is this intended to supersede #1129 ?

Muirrum avatar Aug 14 '24 14:08 Muirrum

Oops, I hadn't realized that there was already another PR open! Feel free to do whatever you'd like with this PR.

I'll clean up the merge conflict in case anyone plans to merge this

garyhtou avatar Aug 15 '24 21:08 garyhtou

I think the one thing this PR is missing is a check script that can be run with CI to make sure the format doesn't break through future PRs. If that happens I think this would be great :)

Muirrum avatar Aug 16 '24 15:08 Muirrum

I already had that in my PR, but if there's a reason it wasn't merged I'm happy to make changes or turn this over to @garyhtou.

northeastprince avatar Aug 16 '24 15:08 northeastprince