uydgxa
Last Updated: February 25, 2016
·
507
· lerrua
Screen shot 2013 03 14 at 8.39.07 pm

remove all whitespaces from your code

for i in `git ls-files *.py *.js *.css *.html`; do echo "$i"; sed -i '' -e 's/[[:space:]]*$//g' "$i";  done

... and bye bye blank spaces generated by some editors.

Say Thanks
Respond

2 Responses
Add your response

4872
43ea08b4fc547e8a5da87c207bea2123

Am I missing something, isn't whitespace syntaxically important in python and CSS?

over 1 year ago ·
4876
Screen shot 2013 03 14 at 8.39.07 pm

@barnettjw I use tabs. There's no room for a one-space error in the tabs (if you can see them). The problem IS that people use different editors, and the only common thing in the world is: tab==indent, as above. Some bloke comes in with the tab key set to the wrong number of spaces or does it manually and makes a mess. TABs and use a real editor. (This isn't just contrary to the python, it's about C/C++ and other whitespace-agnostic languages too).

over 1 year ago ·