Last Updated: February 25, 2016
·
635
· lerrua

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.

2 Responses
Add your response

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

over 1 year ago ·

@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 ·