-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
big trailing whitespace cleanup #6
Conversation
* remove ^M stale characters * strip trailing whitespace this commit is generated with: find . -type f | grep -vF ./.git/ | grep -v \.png$ | xargs sed -i 's/\s\+$//
Trying to apply the patch gives me:
Any idea how to solve it? |
hmm I believe I made that patch on top of your latest (what you pushed to github) develop branch (3a81762) so it should apply to that. try this (from the top of my head): I'm not at work so I cannot doublecheck right now, but that should be it |
Had to resolve some git merge conflicts, but should be ok now. |
I just noticed this removed whitespace even from blank doc comments and blank lines that separate blocks of code; this isn't right, whitespace should be justified at the level of the surrounding code. I'll leave it like this, it's no problem for the Python parser, but I'll need to improve the Thx for bringing up the white space cleanup Dieter, these little things matter too. |
interesting, I thought empty lines should never whitespace, even when there's code above or below, indented any level. is this in a PEP or something? |
I don't think so, at least I never saw such PEP :) It just seems more logical/consistent (plus you can copy&paste such "properly" indented code blocks into python shell, unlike blocks which contain empty lines). Though I expect most Python code uses the more simple greedy stripping anyway (if any), because it's easier to enforce automatically plus it's the norm in other languages. |
where "simple greedy" is what I did, right? |
pep8 & python2 fixes to doc2vec notebook
this change cleans up all trailing whitespace.
you can automatically keep it clean with something like this in your .vimrc:
autocmd BufWritePre *.py :%s/\s+$//e
the ^M's, I'm not sure where those come from, maybe when you edit the files on a Windows machine? I've never seen any unix editor add them.