While there are RFEs for blank lines and indentation,
there isn't yet one for generic formatting of whitespace.
Unwanted spaces have a way of creeping in during copy
and paste operations - and it is easy to omit hitting the
Checkstyle can act as a complement to code formatting
tools - indicating when they need to be applied.
Most formatters can be configured to control the
number of blank spaces before and after various
constructs - and I think Checkstyle should be able
to check for the same sorts of thing.
As an example to start with, one obvious check
in this area is a:
Most formatters are inclined to swallow up multiple
I think this check should be applied outside comments
and should ignore spaces at the beginnings of lines.
That puts it outside the capabilities of the existing
generic regexp check - though it may be possible to
implement in that way in the future.
The next most obvious checks in this area seem to me
One slight complication here is that these checks
would probably be best disabled if the token
occurs at the very start or end of a line - but otherwise
implementation appears straightforward.
Log in to post a comment.