Skip to content

Allow more fine-grained per-rule settings in the Gradle DSL? #461

@RBusarow

Description

@RBusarow

Currently, the DSL allows for individual rule toggles, but auto-correct behavior is global. And the only rule which has a root-level "ignore" list is UnusedDependency with ignoreUnusedFinding.

Other findings have the same problem -- overshot, inheritedDependency, and mustBeApi especially. They should also have a global ignore list, but putting everything top-level in the DSL gets very noisy.

It might make sense to do something like this:

moduleCheck {
  unusedDependency {
    enabled = true
    ignored = listOf(...)
    autoCorrect = true
  }
  inheritedDependency {
    ...
  }
}

This can follow the standard conventions of extension DSLs, so that a more concise configuration is still possible:

moduleCheck {
  unusedDependency.enabled = true
  inheritedDependency.enabled = true
  ...
}

Another option would be to just go the route of a full .yaml config. But there aren't that many rules, and I don't know many people who actually like yaml.

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