-
Notifications
You must be signed in to change notification settings - Fork 224
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 white spaces automatically #935
Comments
I tried the following script (with invisible trailing whitespaces in many lines): """
This is a test.
"""
def add(x, y):
"""
>>> add(5, 4)
9
"""
# this is a comment
return x + y Running Not sure why it hehaves differently in #890. |
No, |
|
Does |
None of |
Related issue: psf/black#318 |
Means it is not possible to do any automatic check and everybody has to care about the spaces before committing, right? |
Perhaps docformatter should remove the trailing whitespace? It says:
|
but does nothing to:
Reported a bug to |
Interesting but good to know that we can differentiate between normal scripts and sphinx-gallery style header docstrings. |
Perhaps we should try https://github.com/DanielNoord/pydocstringformatter. |
Trailing spaces in docstrings sometimes have syntactical meaning (e.g., forcing a markdown line break). As questionable as it is to have some count of non-printing characters trigger a material document change, we are where we are (and Markdown is extremely prevalent). Stripping those trailing spaces in docstrings could break the formatting of parameter lists in IDE code hints (and probably some other stuff I haven't thought of). |
I'm going to close the issue mainly because: (1) it's a minor issue, (2) it does't bother us in the last two years, (3) modern text editors and IDEs have configurations to do it automatically. |
So far trailing white spaces in files are not automatically detected when running
make format
,make check
andmake lint
(see #890) .Do you think we should add such check, if possible, to follow the PEP8 guidelines?
Are you willing to help implement and maintain this feature? Discuss first
The text was updated successfully, but these errors were encountered: