Skip to content

Bug: empty files get an empty line appended #1004

@Wilfred

Description

@Wilfred

Describe the bug

When formatting an empty file with ocamlformat, it append a trailing line.

How to Reproduce

$ touch ~/tmp/empty.ml
$ ocamlformat --enable-outside-detected-project -i ~/tmp/empty.ml

empty.ml ends up with an extra line in it. wc -l empty.ml shows different counts before and after formatting.

Tested against ocamlformat at e94fa81.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions