scalastyle/scalastyle — pull request #116 by bensymonds (2014-08-07 12:41:28+00:00)
Title: Fix bug: `EnsureSingleSpaceBeforeTokenChecker` when there is a newline after token

Should hopefully be fairly obvious what the bug is from the test cases, but in case not: the space presence/absence is only checked if there are no newlines to the right of the token. Obviously this makes sense if the check is for *after* token (since if the expression has gone onto a new line, we don't care about having a space - the newline *is* the space). But if the check is *before* token, then it doesn't matter if newline is there or not.

I picked `{` as the test token because it produced the simplest examples I could think of. I can see us using it for other tokens like `=>`, `->` etc.

It didn't really feel like I needed `testNewLine()` and `testEdgeCases()` like the other, similar checkers have.