Skip to content

Commit 10db72d

Browse files
committed
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`.
1 parent c3cf48c commit 10db72d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/jsonschema/generate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func GetSchemaDir() string {
2020
func GenerateSchema() {
2121
schema := customReflect(&config.UserConfig{})
2222
obj, _ := json.MarshalIndent(schema, "", " ")
23+
obj = append(obj, '\n')
2324

2425
if err := os.WriteFile(GetSchemaDir()+"/config.json", obj, 0o644); err != nil {
2526
fmt.Println("Error writing to file:", err)

schema/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1725,4 +1725,4 @@
17251725
},
17261726
"additionalProperties": false,
17271727
"type": "object"
1728-
}
1728+
}

0 commit comments

Comments
 (0)