Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black sometimes adds two newlines at the end of file and doesn't remove it by itself on reformatting #1006

Closed
Kushagra-0801 opened this issue Sep 5, 2019 · 3 comments
Labels
R: invalid This issue / pull request doesn't seem right T: bug Something isn't working

Comments

@Kushagra-0801
Copy link

Operating System: Ubuntu 19.04
Python version: 3.7.4
Black version: 19.3b0
Editor: VS Code (snap)
Happens on the branch installed by pip
Black sometimes adds an extra newline at the end of the file (mostly when there already is a newline there, I think). The newline is not removed on reformatting. Once I remove it, it doesn't happen again.
It doesn't happen a lot so I haven't seen any clear pattern to it.

@JelleZijlstra
Copy link
Collaborator

Could you give an example that reproduces this bug?

I wonder if this could be a bug in your editor integration or IDE.

@ichard26
Copy link
Collaborator

ichard26 commented Jul 19, 2020

This is most likely a bug with Visual Studio Code Python extension's diff handling. The (highly likely) duplicate issue of this issue has linked this: microsoft/vscode-python#11001.

@JelleZijlstra
Copy link
Collaborator

Seems unlikely that this is a bug in Black. Closing in favor of the VSCode issue.

@ichard26 ichard26 added R: invalid This issue / pull request doesn't seem right T: bug Something isn't working labels May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R: invalid This issue / pull request doesn't seem right T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants