I have yet to find a good solution for this, and I really wish that there was one. Regarding @Gizmomogwai's tip, it doesn't exactly work as you'd think.
First of all, you need to export JAVA_OPTS=-Dantlr.ast:groovy
. However, the file produced by groovyc
is clearly not "pretty" in the sense that it is pretty to humans. The "pretty" output generates a file which will be parsed by the next stage of the compiler. Effectively, this means that it not only strips comments but also will add and alter newlines and whitespace. It is definitely not suitable for checking code formatting.