Skip to content

Change MatchingDeclarationName to handle utility files #1500

@scottkennedy

Description

@scottkennedy

Context

This is based on the discussion at the bottom of #841

I have a utility file. It consists almost exclusively of top-level functions. However, one of these returns an instance of a data class that is also declared in this file. Because that is the only top-level class/object, Detekt says the file should be named after that data class, even though it's fairly insignificant.

As @arturbosch suggested, something like allowClassesWithModifiers = "data,enum" may be a reasonable configuration option to handle this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions