Skip to content

Running detektBaseline generates too general exceptions, disabling rules #2471

Closed
@mrf7

Description

@mrf7

Expected Behavior

When generating a baseline for a code base, only the existing issues should be ignored when using it.

Observed Behavior

Running detektBaseline via gradle generates files that contains lines such as
<ID>NoBlankLineBeforeRbrace:</ID> which have no reference to a specific instance of the violation. This results in the rule being ignored entirely in the module when using the baseline file.

Steps to Reproduce

Steps to reproduce is uncertain. This issue was seen when running detektBaseline on a multiple module android project with many (~1000) issues in existing code.

Context

When trying to add detekt to a project and generate a baseline to avoid failing builds on old issues, it ends up disabling rules for new code as well.

Your Environment

  • Version of detekt used: 1.6.0
  • Version of Gradle used (if applicable): 5.4.1
  • Operating System and version: OSX
  • Link to your project (if it's a public repository):

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions