From 10db72d22393329df73cdace04bba757664d2ca1 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 30 Nov 2024 15:03:29 +0100 Subject: [PATCH] Let schema/config.json end with a line feed Some editors add one automatically when saving the file, which causes confusion and ugly diffs containing `\ No newline at end of file`. --- pkg/jsonschema/generate.go | 1 + schema/config.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/jsonschema/generate.go b/pkg/jsonschema/generate.go index 582e84849..be28519e3 100644 --- a/pkg/jsonschema/generate.go +++ b/pkg/jsonschema/generate.go @@ -20,6 +20,7 @@ func GetSchemaDir() string { func GenerateSchema() { schema := customReflect(&config.UserConfig{}) obj, _ := json.MarshalIndent(schema, "", " ") + obj = append(obj, '\n') if err := os.WriteFile(GetSchemaDir()+"/config.json", obj, 0o644); err != nil { fmt.Println("Error writing to file:", err) diff --git a/schema/config.json b/schema/config.json index 876a5bab9..7b0ef0b2b 100644 --- a/schema/config.json +++ b/schema/config.json @@ -1725,4 +1725,4 @@ }, "additionalProperties": false, "type": "object" -} \ No newline at end of file +}