-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove trailing whitespace #1114
Labels
R: invalid
This issue / pull request doesn't seem right
Comments
this can be fixed using vscode feature instead: settings.json "[python]": {
"files.trimTrailingWhitespace": true,
},
... |
Black already does this. richard-26@ubuntu-laptop:~/programming/tools/ghprcl$ black test.py
reformatted test.py
All done! ✨ 🍰 ✨
1 file reformatted.
richard-26@ubuntu-laptop:~/programming/tools/ghprcl$ diff -u --color orig.py test.py
--- orig.py 2020-07-28 17:45:02.959401063 -0400
+++ test.py 2020-07-28 17:44:46.307273954 -0400
@@ -1 +1 @@
-s = "Hello world!"
+s = "Hello world!" BEFOREand AFTERThis seems like a problem with how Visual Studio Code handling of diffs. Maybe related to this? Environment:
|
Closing as this is most likely an issue with VSCode, not Black. |
ichard26
added
R: not a bug
This is deliberate behavior of Black.
C: invalid code
Black destroyed a valid Python file
R: invalid
This issue / pull request doesn't seem right
and removed
T: enhancement
New feature or request
R: not a bug
This is deliberate behavior of Black.
C: invalid code
Black destroyed a valid Python file
labels
May 29, 2021
Try these in {
"python.formatting.provider": "black",
"[python]": {
"files.trimTrailingWhitespace": true,
"editor.formatOnSave": true
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem?
Running black (in VSCode) does not remove trailing whitespaces.
s = 'Hello world!"_ _
Describe the solution you'd like
Rather, I'd like black to remove trailing whitespace on all lines.
s = 'Hello world!"
Describe alternatives you've considered
I have to do a followup "Trim Whitespace" command in VSCode. I'd like this to be part of black by default.
There are some prior issues (#567) regarding trailing whitespace inside strings. Removing trailing whitespace by default can clean up code and even save some wasted space.
The text was updated successfully, but these errors were encountered: