How do we feel about whitespace patches to java code?  I've added "let
java_space_errors=1" to my $HOME/.vimrc, so when I use vim, I see bad
spaces highlighted in red.  The things that get highlighed are
trailing space or tab, lines that *only* contain space, and mixed
space/tab at the beginning of a line.

Fix this is semi-automatic.  Trailing space and only space are fixed with:

==
find -name '*.java' | xargs sed -i -e 's/\([^\s]\)\s\+$/\1/;s/^[\s]\+$//'
==

Finding files with mixed space/tab is done with:

==
(tab=$(printf '\t'); find -name '*.java' | xargs egrep
"^( +$tab|$tab+ )" -l)
==

If given the ok, I'll start fixing this minor issue.  However, it
could cause conflicts with anyone else who has uncommitted changes.

ps: The patch against framework/base to fix these issues is 260k in
size, 981 insertions/deletions, and only deals with java files.

Reply via email to