GroovyLint is a library for Groovy that adds additional compile time checks.
The sooner a problem is caught, the less time you have to spend debugging it.
To set up GroovyLint, follow these steps:
GroovyLint has mainly been tested with Eclipse, but it should work in any IDE that supports Groovy. Here is a screenshot of it working in Eclipse:
Even though you could use metaprogramming to do tricky things like making 5 + 5 return the String "hello", or changing a method to return a Map instead of a boolean, that probably isn't a good idea because it's confusing.
A lot of GroovyLint errors could be valid Groovy code, but the majority of the time it will be an error. And you can always turn off certain GroovyLint errors if they clash with your style of programming.
To disable a warning for a certain class or method, add the
@DisableGroovyLint("warning_to_disable") annotation
to the class or method. You can also disable a warning project-wide by
creating a GroovyLintSettings.groovy file. For more details click here.
Groovy lets developers extend the Groovy compiler by writing abstract syntax tree (AST) transformations. GroovyLint is an AST transformation that performs various checks on the abstract syntax tree of your program.
GroovyLint is licensed under the same license as Groovy: Apache License v2.0. Basically, you can use GroovyLint for whatever you want, as long as you leave copyright notices intact.
There are a few things that I haven't been able to figure out how to do yet for GroovyLint. If you have a suggestion, please post it on the GroovyLint Group