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
Strip trailing whitespace from all files #1757
Comments
Whitespace at the end of lines and/or between lines is inconsequential per our style guide. It's the whitespace at the beginning of lines that we care about. See here: http://processwire.com/api/coding-style-guide/#2.3-indentation-tabs-spaces |
Hi Ryan, sorry, I was thinking about unnecessary whitespace at the and of lines (after semicolon etc.) which is just noise… You can see in the screenshot that it looks like there are a lot of a changes made, but just spaces was removed… also file size can be a little smaller… … or there is added whitespace (1ea08e6) I use TextWrangler on a mac which has an option "Strip trailing whitespace" before save… It would be nice if git has that option too, after commit, or just making sure trailing whitespace was removed before commit so only real useful changes will be committed… |
While I agree that consistency is a good thing, even when it comes to small things, I can't say that I see much real value in this. Hopefully I don't sound too rude, but in my opinion going through all files just to remove trailing whitespace would be micro-optimization at best, and for the most part just waste of time. Additionally I think you might've missed the part of the ProcessWire coding style guide Ryan was pointing to, as it clearly states that whitespace at the end of lines is perfectly fine:
If it's GitHub diff you're worried about, try appending "?w=1" at the end of the URL and it won't display space changes anymore. If you're using git client locally, you can add the -w flag to get the same result there. |
Thanks @teppokoivula, I'm new to git and didn't know about that option… I still can't see the point of having whitespace at the end of lines, but as you mentioned, is just micro-optimization… not a big deal… It wouldn't be hard to clean that up… even trough some PHP script ( |
Admittedly I find a space at the end of lines helpful in my editing On Wed, Apr 6, 2016 at 5:43 AM, Jany notifications@github.com wrote:
|
There is unnecessary trailing whitespace in almost every file… Needs to be cleaned up…
The text was updated successfully, but these errors were encountered: