Skip to content

Make a rule for variables declared/assigned without an explicit type #469

@nre-ableton

Description

@nre-ableton

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions