ffnord / ffmap-backend

THIS PROJECT DOESN'T HAVE A MAINTAINER!
Other
20 stars 59 forks source link

Make the json outputs diffable by sorting its keys #71

Closed mweinelt closed 8 years ago

mweinelt commented 8 years ago

This enables the use of diff to compare the output files.

flokli commented 8 years ago

:+1:

jplitza commented 8 years ago

Diffing output files seems like an unusual usecase, and sorting the keys has no advantage for the usual usecases like lists and maps of nodes. Is it worth sorting the keys on every generation rather than sorting them on demand when you want to compare files? (Piping through jq -S . would do exactly that)

flokli commented 8 years ago

@jplitza sure, one could also sort them on demand. But it doesn't really hurt to already serve them sorted, so why not?

jplitza commented 8 years ago

I still have a bit of stomach pain by using CPU cycles for something rarely used, but what the hell…