-
Notifications
You must be signed in to change notification settings - Fork 26
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
Clarify behavior of trim_trailing_whitespace #2
Comments
This rule shall be implemented as a file-save operation. See https://github.com/editorconfig/editorconfig/wiki/Plugin-Guidelines#trim_trailing_whitespace On file save, any/all trailing whitespace shall be removed. This means you could open up a tainted file, save it and all previously-existing trailing whitespace shall be removed, even though no file changes were made. |
Is my suggestion to add "in the file" after "whitespace characters" a good one? If so, I will open a PR for that. Or do we need better wording? |
I have a metaquestion --- should questions like this one about the content of the specification be in this repo, or should they still be in editorconfig/editorconfig? My understanding has been that substantive questions went over in the editorconfig repo, but perhaps that has changed now that this repo is open. |
@cxw42 I think this issue is properly raised here, because it is about changing the text to clarify some part of the specification, not about proposing changes to the substance of the specification. |
@xuhdev In view of #3 and your comment above, I suggest the Board consider disabling issues here, or changing the way editorconfig/editorconfig is used. #3 appears substantive to me, and I can't fault the poster for opening a specification issue in a repo called "specification" ;) . Another option would be to add an issue template here pointing people to the other repo, but the experience of Stack Overflow suggests that may not be 100% effective. |
Fixes editorconfig#8 Fixes editorconfig#2
Co-authored-by: Hong Xu <[email protected]>
One of the things that need to be clarified is how
trim_trailing_whitespace = true
is expected to work.At the moment almost all implementations I use trim all the trailing whitespaces that exist in a file on save. IMHO that is the expected behavior.
The native Visual Studio implementation only trims whitespaces when enter is pressed at the end of a line. That seems fairly odd and unexpected behavior to me, but "it works as designed" they say: https://developercommunity.visualstudio.com/content/problem/134457/editorconfig-trim-trailing-whitespace-only-applies.html
In their case it even means that when you are at the end of a line, press space or tab followed by any arrow key (or alike) the trailing whitespace remains in the file, despite the setting
trim_trailing_whitespace = true
.By clarifying the expected behavior we can strive for more consistent between the various implementations. Right now on our website it says:
I would suggest to add something like "in the file" after "whitespace characters".
The text was updated successfully, but these errors were encountered: