yapf adds newline to end of file when reading source file from stdin
Open
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
As per #195, yapf shouldn't add a trailing newline to an empty file. It mostly doesn't, but if you run against stdin instead of a named file for some reason it does:
```
$ echo -n | yapf --style=pep8 | wc -c
1
$ touch empty
$ yapf --style=pep8 empty | wc -c
0
```
I tested this running against a2f034296536867f79e3843fb8cc3d5a90c941db under Python 3.5.1
Contributor guide
Assessment
This issue has not been assessed yet.