Some tips from someone who struggled with whitespace errors forever: 

1) You can configure vim with the .vimrc file and have it show you whitespace with big scary red blocks right in the text editor 
2) Before you commit your changes if you do a `git diff` it should show you the insertions and deletions including any added whitespace errors