Skip to content
Snippets Groups Projects
Unverified Commit e56f6450 authored by Braden Shepherdson's avatar Braden Shepherdson Committed by GitHub
Browse files

Serdes v2: Order the YAML keys alphabetically (#25021)

This is a simple expedient: convert our entities to a `(sorted-map)` before
passing them to the YAML writer!
This gives a consistent, platform-agnostic order between dumps.
(It might have already been fine, since it's based on Clojure's `hash`?)
parent 9c61561d
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@
(defn- spit-yaml
[file obj]
(io/make-parents file)
(spit (io/file file) (yaml/generate-string obj :dumper-options {:flow-style :block})))
(spit (io/file file) (yaml/generate-string (into (sorted-map) obj) :dumper-options {:flow-style :block})))
(defn- store-entity! [{:keys [root-dir]} entity]
(spit-yaml (u.yaml/hierarchy->file root-dir (serdes.base/serdes-path entity))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment