Skip to content

Commit

Permalink
Let schema/config.json end with a line feed (jesseduffield#4092)
Browse files Browse the repository at this point in the history
- **PR Description**

Some editors add one automatically when saving the file, which causes
confusion and ugly diffs containing `\ No newline at end of file`.
  • Loading branch information
stefanhaller authored Nov 30, 2024
2 parents c3cf48c + 10db72d commit 579053d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/jsonschema/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion schema/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1725,4 +1725,4 @@
},
"additionalProperties": false,
"type": "object"
}
}

0 comments on commit 579053d

Please sign in to comment.