From 97fdbbcdf5d7984fe2f01b7e68fdb1ca916efdf6 Mon Sep 17 00:00:00 2001 From: Joscha Date: Wed, 21 Jan 2026 16:00:30 +0100 Subject: [PATCH] Format json files deterministically and make diffs useful --- pasch/file/json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pasch/file/json.py b/pasch/file/json.py index b09b4a5..44ec677 100644 --- a/pasch/file/json.py +++ b/pasch/file/json.py @@ -76,7 +76,7 @@ class JsonFile(File): self.set(path, TAG) def to_text(self) -> TextFile: - return TextFile(json.dumps(self.data)) + return TextFile(json.dumps(self.data, sort_keys=True, indent=2) + "\n") def to_bytes(self) -> bytes: return self.to_text().to_bytes()