So all of these variable declarations are valid in groovy:
def foo = 'bar' // Bad, but CodeNarc will catch this with NoDef
String foo = 'bar' // Ideal
foo = 'bar' // Bad, but CodeNarc won't catch this
That last case should be treated as a violation. It is technically an assignment, but lacks any explicit type.
So all of these variable declarations are valid in groovy:
That last case should be treated as a violation. It is technically an assignment, but lacks any explicit type.