When running in 'manual' mode, users expect to be able to fix individual lint violations via the autocorrect of ktlint. In older versions of the plugin this option was already available, but once chosen it would autocorrect all lint violations in the file for which the autocorrect is available. Typically, users of the 'manual' mode want to be in control and determine which autocorrect fix is to be applied, and which fix is not to be applied.
The autocorrect option for an individual lint violation, will only be offered when all following conditions are met:
The lint violation has an autocorrect fix available
The rule which reports the lint violations has implemented the AutocorrectApproveHandler interface which is introduced in ktlint version 1.3.0. This interface is implemented on all rules provided by the ktlint project. Providers for custom ruleset have to implement this interface in order to sypport autocorrect of individual lint violations.
When running in 'manual' mode, users expect to be able to fix individual lint violations via the autocorrect of ktlint. In older versions of the plugin this option was already available, but once chosen it would autocorrect all lint violations in the file for which the autocorrect is available. Typically, users of the 'manual' mode want to be in control and determine which autocorrect fix is to be applied, and which fix is not to be applied.
The autocorrect option for an individual lint violation, will only be offered when all following conditions are met:
AutocorrectApproveHandler
interface which is introduced in ktlint version1.3.0
. This interface is implemented on all rules provided by the ktlint project. Providers for custom ruleset have to implement this interface in order to sypport autocorrect of individual lint violations.