Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Formatting adds newline at the end on file on each format #282

Closed
sirideain opened this issue Apr 28, 2017 · 1 comment
Closed

Formatting adds newline at the end on file on each format #282

sirideain opened this issue Apr 28, 2017 · 1 comment

Comments

@sirideain
Copy link

Running rustfmt adds a single newline no matter how many times I run it. Every time I format here, an extra newline is added at the end of the file.

Windows 10
VS Code
VSCode-Rust extension setup to use RLS

@nrc nrc mentioned this issue May 12, 2017
9 tasks
@nrc
Copy link
Member

nrc commented Jun 16, 2017

Observation:

  • If there are no trailing newlines, rustfmt adds one (correct)
  • If there is one trailing newline, rustfmt adds another one (incorrect)
  • If there are more than one trailing newlines, rustfmt does nothing (incorrect)

I expect that we are not passing the last newline (if it exists) to rustfmt.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants