autoCorrect

Whether this rule should correct the code it reports on.

Only rules implementing AutoCorrectable can correct anything, so for every other rule this is always false. For those that can, the value is resolved in priority order:

  • the autoCorrect property of the rule

  • the autoCorrect property of the parent rule set

  • true, as a rule which is able to correct is expected to do so

The --auto-correct CLI flag (and its Gradle counterpart) remains the master switch: when it is off, detekt forces autoCorrect to false for every rule regardless of configuration.