Search code examples
eclipsegroovyconventionscheckstyletype-safety

Enforce type specification on public members of Groovy types


In Groovy, specifying types is optional. But there are advantages to specifying them on public class members like methods and properties. It's a good form of documentation and it enables IDEs to perform auto-completion, refactor code, find references, and other static analysis tasks more reliably as described in this Groovy Coding Style article.

Is there a way to enforce this policy in Eclipse so that a warning will appear when a public member is missing an explicit type? Something along the lines of a Checkstyle or FindBugs tool for Groovy would be great.


Solution

  • No, there is nothing like this in Groovy-Eclipse at the moment, but this is an interesting idea. You can raise an enhancement request for this:

    http://jira.codehaus.org/browse/GRECLIPSE